@indfnd/utils 0.1.32 → 0.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/ind-utils.es.js +31 -9
- package/dist/ind-utils.umd.cjs +10 -10
- package/package.json +1 -1
- package/src/api/permission.ts +11 -2
- package/src/api/platform/config.js +22 -0
- package/src/api/platform/index.ts +1 -0
- package/src/api/user.ts +9 -2
- package/types/api/com.d.ts +4 -2
- package/types/api/index-desc.d.ts +4 -2
- package/types/api/index.d.ts +7 -7
- package/types/api/item.d.ts +6 -4
- package/types/api/permission.d.ts +2 -2
- package/types/api/permission.d.ts.map +1 -1
- package/types/api/platform/config.d.ts +2 -0
- package/types/api/platform/config.d.ts.map +1 -0
- package/types/api/platform/dict.d.ts +6 -4
- package/types/api/platform/index.d.ts +1 -0
- package/types/api/platform/index.d.ts.map +1 -1
- package/types/api/platform/menu.d.ts +21 -11
- package/types/api/platform/oss.d.ts +15 -7
- package/types/api/platform/user.d.ts +19 -12
- package/types/api/user.d.ts +2 -2
- package/types/api/user.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.33](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.32...v0.1.33) (2026-01-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* 会话信息从Local改为session ([3443e11](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/3443e1108f88f1f642e7a3a609d9c5db6837c722))
|
|
11
|
+
* 解决报错 ([9f26a0f](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/9f26a0fd714471fab47d31ae0f52849f7913d79d))
|
|
12
|
+
* 修改缓存逻辑 ([df098e0](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/df098e0d87d0c35f55035ca668219f9c40d55528))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* 修改缓存key及是否开启 ([7272abc](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/7272abcc77c198de29a7f322bc11bd932c59809e))
|
|
18
|
+
|
|
5
19
|
### [0.1.32](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.31...v0.1.32) (2026-01-15)
|
|
6
20
|
|
|
7
21
|
|
package/dist/ind-utils.es.js
CHANGED
|
@@ -11368,6 +11368,18 @@ function getCaptchaURL(validCodeId) {
|
|
|
11368
11368
|
function logoutApi() {
|
|
11369
11369
|
return instance.get(`${CONTEXT$2}/sso/logout`);
|
|
11370
11370
|
}
|
|
11371
|
+
const GLOBAL_CACHE_KEY = "global-cache";
|
|
11372
|
+
const getGlobalConfig = () => __async(void 0, null, function* () {
|
|
11373
|
+
if (getSessionStorage(GLOBAL_CACHE_KEY)) {
|
|
11374
|
+
return getSessionStorage(GLOBAL_CACHE_KEY);
|
|
11375
|
+
} else {
|
|
11376
|
+
let url = location.protocol + "//" + location.host + "/ibp-sc/manage/global?t=" + new Date().getTime();
|
|
11377
|
+
return axios.get(url).then(({ data: data2 }) => {
|
|
11378
|
+
setSessionStorage(GLOBAL_CACHE_KEY, data2);
|
|
11379
|
+
return data2;
|
|
11380
|
+
});
|
|
11381
|
+
}
|
|
11382
|
+
});
|
|
11371
11383
|
const CONTEXT$1 = config.ismAmServerContext;
|
|
11372
11384
|
function listComTreeApi(params) {
|
|
11373
11385
|
if (config.useDddComItemTree) {
|
|
@@ -11395,11 +11407,17 @@ function getItem(params) {
|
|
|
11395
11407
|
return instance.get(`${CONTEXT}/basic/getItem`, { params });
|
|
11396
11408
|
}
|
|
11397
11409
|
const UC_CONTEXT$1 = config.ucExtServerContext;
|
|
11398
|
-
const DATAVERSION_KEY$1 = "ind-cache-dataVersion-applicationTree";
|
|
11399
11410
|
function getApplicationTreeApi(params) {
|
|
11400
11411
|
return __async(this, null, function* () {
|
|
11401
|
-
var _a;
|
|
11402
|
-
const
|
|
11412
|
+
var _a, _b;
|
|
11413
|
+
const DATAVERSION_KEY = "ind-cache-dataVersion-applicationTree" + ((_a = getUserInfoCache()) == null ? void 0 : _a.manageUnitId);
|
|
11414
|
+
const globalConfigData = yield getGlobalConfig();
|
|
11415
|
+
if (!(globalConfigData == null ? void 0 : globalConfigData.enableTreeLocalCache) || (globalConfigData == null ? void 0 : globalConfigData.enableTreeLocalCache) !== "1") {
|
|
11416
|
+
return instance.formPost(`${UC_CONTEXT$1}/tree/uc-application/getApplicationTree`, {
|
|
11417
|
+
params
|
|
11418
|
+
});
|
|
11419
|
+
}
|
|
11420
|
+
const cachedData = getLocalStorage(DATAVERSION_KEY);
|
|
11403
11421
|
const dataVersionList = yield instance.get(`${UC_CONTEXT$1}/cacheManage/getCacheDataVersion`, {});
|
|
11404
11422
|
const serverVersion = dataVersionList.data["applicationTree"];
|
|
11405
11423
|
if ((cachedData == null ? void 0 : cachedData.dataVersion) !== serverVersion) {
|
|
@@ -11410,16 +11428,20 @@ function getApplicationTreeApi(params) {
|
|
|
11410
11428
|
dataVersion: serverVersion,
|
|
11411
11429
|
response
|
|
11412
11430
|
};
|
|
11413
|
-
setLocalStorage(DATAVERSION_KEY
|
|
11431
|
+
setLocalStorage(DATAVERSION_KEY, dataValue);
|
|
11414
11432
|
}
|
|
11415
|
-
return (
|
|
11433
|
+
return (_b = getLocalStorage(DATAVERSION_KEY)) == null ? void 0 : _b.response;
|
|
11416
11434
|
});
|
|
11417
11435
|
}
|
|
11418
11436
|
const UC_CONTEXT = config.ucExtServerContext;
|
|
11419
|
-
const DATAVERSION_KEY = "ind-cache-dataVersion-organTree";
|
|
11420
11437
|
function listUserTreeApi(params) {
|
|
11421
11438
|
return __async(this, null, function* () {
|
|
11422
|
-
var _a;
|
|
11439
|
+
var _a, _b;
|
|
11440
|
+
const DATAVERSION_KEY = "ind-cache-dataVersion-organTree" + ((_a = getUserInfoCache()) == null ? void 0 : _a.manageUnitId);
|
|
11441
|
+
const globalConfigData = yield getGlobalConfig();
|
|
11442
|
+
if (!(globalConfigData == null ? void 0 : globalConfigData.enableTreeLocalCache) || (globalConfigData == null ? void 0 : globalConfigData.enableTreeLocalCache) !== "1") {
|
|
11443
|
+
return instance.get(`${UC_CONTEXT}/tree/uc-user/listUserTree`, { params });
|
|
11444
|
+
}
|
|
11423
11445
|
const cachedData = getLocalStorage(DATAVERSION_KEY);
|
|
11424
11446
|
const dataVersionList = yield instance.get(`${UC_CONTEXT}/cacheManage/getCacheDataVersion`, {});
|
|
11425
11447
|
const serverVersion = dataVersionList.data["organTree"];
|
|
@@ -11431,7 +11453,7 @@ function listUserTreeApi(params) {
|
|
|
11431
11453
|
};
|
|
11432
11454
|
setLocalStorage(DATAVERSION_KEY, dataValue);
|
|
11433
11455
|
}
|
|
11434
|
-
return (
|
|
11456
|
+
return (_b = getLocalStorage(DATAVERSION_KEY)) == null ? void 0 : _b.response;
|
|
11435
11457
|
});
|
|
11436
11458
|
}
|
|
11437
|
-
export { Base64ForLogin, CONTENT_TYPE, IS_OR_NOT_ENUM, IS_OR_NOT_ENUM_KEY, IS_OR_NOT_ENUM_LIST, MIME_TYPE, UC_ENUM, addMenuCollectApi, instance as axios, base64ToBlob, blobToBase64, checkIdCard, checkPhone, checkTel, checkVehicleNo, clearIndexDescCache, clearPermissionCache, clearSessionStorage, clearUserInfoCache, config, cryptor, deleteMenuCollectApi, deleteMenuHistoryApi, exportJsonToExcel, flattenRow2ColumnData, formatDate, formatDateChinese, formatDecimal, formatHalfYear, formatQuarter, getAppListApi, getApplicationTreeApi, getCaptchaURL, getContentType, getDictApi, getDictMapApi, getDictsMapApi, getExcelColumnIdx, getGlobalPolicyApi, getHalfYear, getHalfYearBeginMonth, getHalfYearEndMonth, getHalfYearNum, getIndexDescCache, getItem, getLocalStorage, getMaxTabNumValueApi, getMenuCollectApi, getMenuHistoryApi, getOssFileApi, getOssFileUrl, getPermissionApi, getPermissionCache, getPreviewUrlApi, getPriceInfo, getQuarter, getQuarterBeginMonth, getQuarterEndMonth, getQuarterNum, getSessionStorage, getToken, getType, getUrlParams, getUserInfoApi, getUserInfoCache, guid, importJsonFromExcel, isArguments, isArray, isArrayLike, isBoolean, isDate, isDecimal, isElement, isEmpty, isEqual, isEqualWith, isError, isEven, isFinite$1 as isFinite, isFunction, isInteger, isNegative, isNil, isNull, isNumber, isNumberEqual, isObject, isObjectLike, isOdd, isPlainObject, isPositive, isPromise, isPrototype, isRegExp2 as isRegExp, isString, isType, isUndefined, listComTreeApi, listIndexDescApi, listItemTreeApi, listUserTreeApi, loginApi, logoutApi, menuHistoryApi, numToChineseNumerals, numToDX, off, on, preventDefault, putOssFileApi, putOssFileUrl, quarter2Chinese, removeLocalStorage, removeMenuCollectApi, removeSessionStorage, renderColumnEnums, renderEnumData, renderEnumList, renderFieldEnums, responseInterceptors, round, row2column, setConfig, setContentType, setIndexDescCache, setLocalStorage, setPermissionCache, setSessionStorage, setToken, setUserInfoCache, stopPropagation, str2Date, toChies, toFixed, toThousands, updatePasswordApi, useConfig, uuid, wrapApi };
|
|
11459
|
+
export { Base64ForLogin, CONTENT_TYPE, IS_OR_NOT_ENUM, IS_OR_NOT_ENUM_KEY, IS_OR_NOT_ENUM_LIST, MIME_TYPE, UC_ENUM, addMenuCollectApi, instance as axios, base64ToBlob, blobToBase64, checkIdCard, checkPhone, checkTel, checkVehicleNo, clearIndexDescCache, clearPermissionCache, clearSessionStorage, clearUserInfoCache, config, cryptor, deleteMenuCollectApi, deleteMenuHistoryApi, exportJsonToExcel, flattenRow2ColumnData, formatDate, formatDateChinese, formatDecimal, formatHalfYear, formatQuarter, getAppListApi, getApplicationTreeApi, getCaptchaURL, getContentType, getDictApi, getDictMapApi, getDictsMapApi, getExcelColumnIdx, getGlobalConfig, getGlobalPolicyApi, getHalfYear, getHalfYearBeginMonth, getHalfYearEndMonth, getHalfYearNum, getIndexDescCache, getItem, getLocalStorage, getMaxTabNumValueApi, getMenuCollectApi, getMenuHistoryApi, getOssFileApi, getOssFileUrl, getPermissionApi, getPermissionCache, getPreviewUrlApi, getPriceInfo, getQuarter, getQuarterBeginMonth, getQuarterEndMonth, getQuarterNum, getSessionStorage, getToken, getType, getUrlParams, getUserInfoApi, getUserInfoCache, guid, importJsonFromExcel, isArguments, isArray, isArrayLike, isBoolean, isDate, isDecimal, isElement, isEmpty, isEqual, isEqualWith, isError, isEven, isFinite$1 as isFinite, isFunction, isInteger, isNegative, isNil, isNull, isNumber, isNumberEqual, isObject, isObjectLike, isOdd, isPlainObject, isPositive, isPromise, isPrototype, isRegExp2 as isRegExp, isString, isType, isUndefined, listComTreeApi, listIndexDescApi, listItemTreeApi, listUserTreeApi, loginApi, logoutApi, menuHistoryApi, numToChineseNumerals, numToDX, off, on, preventDefault, putOssFileApi, putOssFileUrl, quarter2Chinese, removeLocalStorage, removeMenuCollectApi, removeSessionStorage, renderColumnEnums, renderEnumData, renderEnumList, renderFieldEnums, responseInterceptors, round, row2column, setConfig, setContentType, setIndexDescCache, setLocalStorage, setPermissionCache, setSessionStorage, setToken, setUserInfoCache, stopPropagation, str2Date, toChies, toFixed, toThousands, updatePasswordApi, useConfig, uuid, wrapApi };
|