@indfnd/utils 0.1.31 → 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 CHANGED
@@ -2,6 +2,27 @@
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
+
19
+ ### [0.1.32](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.31...v0.1.32) (2026-01-15)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * 修改getApplicationTreeApi请求方式 ([1538571](http://git.inspur.com/imp-ec/ind-front/ind-utils/commit/1538571d0a87a4a210d21e5037a94d1be5e123ae))
25
+
5
26
  ### [0.1.31](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.30...v0.1.31) (2026-01-14)
6
27
 
7
28
  ### [0.1.30](http://git.inspur.com/imp-ec/ind-front/ind-utils/compare/v0.1.29...v0.1.30) (2026-01-14)
@@ -114,13 +114,13 @@ function clearPermissionCache() {
114
114
  }
115
115
  const USER_INFO_KEY = "lambo-userInfo";
116
116
  function getUserInfoCache() {
117
- return getLocalStorage(USER_INFO_KEY);
117
+ return getSessionStorage(USER_INFO_KEY);
118
118
  }
119
119
  function setUserInfoCache(data2) {
120
- setLocalStorage(USER_INFO_KEY, data2);
120
+ setSessionStorage(USER_INFO_KEY, data2);
121
121
  }
122
122
  function clearUserInfoCache() {
123
- removeLocalStorage(USER_INFO_KEY);
123
+ removeSessionStorage(USER_INFO_KEY);
124
124
  }
125
125
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
126
126
  function getAugmentedNamespace(n) {
@@ -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,43 +11407,53 @@ 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-organTree";
11399
- function listUserTreeApi(params) {
11410
+ function getApplicationTreeApi(params) {
11400
11411
  return __async(this, null, function* () {
11401
- var _a;
11402
- const cachedData = getLocalStorage(DATAVERSION_KEY$1);
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
- const serverVersion = dataVersionList.data["organTree"];
11422
+ const serverVersion = dataVersionList.data["applicationTree"];
11405
11423
  if ((cachedData == null ? void 0 : cachedData.dataVersion) !== serverVersion) {
11406
- const response = yield instance.get(`${UC_CONTEXT$1}/tree/uc-user/listUserTree`, { params });
11424
+ const response = yield instance.formPost(`${UC_CONTEXT$1}/tree/uc-application/getApplicationTree`, {
11425
+ params
11426
+ });
11407
11427
  const dataValue = {
11408
11428
  dataVersion: serverVersion,
11409
11429
  response
11410
11430
  };
11411
- setLocalStorage(DATAVERSION_KEY$1, dataValue);
11431
+ setLocalStorage(DATAVERSION_KEY, dataValue);
11412
11432
  }
11413
- return (_a = getLocalStorage(DATAVERSION_KEY$1)) == null ? void 0 : _a.response;
11433
+ return (_b = getLocalStorage(DATAVERSION_KEY)) == null ? void 0 : _b.response;
11414
11434
  });
11415
11435
  }
11416
11436
  const UC_CONTEXT = config.ucExtServerContext;
11417
- const DATAVERSION_KEY = "ind-cache-dataVersion-applicationTree";
11418
- function getApplicationTreeApi(params) {
11437
+ function listUserTreeApi(params) {
11419
11438
  return __async(this, null, function* () {
11420
- 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
+ }
11421
11445
  const cachedData = getLocalStorage(DATAVERSION_KEY);
11422
11446
  const dataVersionList = yield instance.get(`${UC_CONTEXT}/cacheManage/getCacheDataVersion`, {});
11423
- const serverVersion = dataVersionList.data["applicationTree"];
11447
+ const serverVersion = dataVersionList.data["organTree"];
11424
11448
  if ((cachedData == null ? void 0 : cachedData.dataVersion) !== serverVersion) {
11425
- const response = yield instance.get(`${UC_CONTEXT}/tree/uc-application/getApplicationTree`, {
11426
- params
11427
- });
11449
+ const response = yield instance.get(`${UC_CONTEXT}/tree/uc-user/listUserTree`, { params });
11428
11450
  const dataValue = {
11429
11451
  dataVersion: serverVersion,
11430
11452
  response
11431
11453
  };
11432
11454
  setLocalStorage(DATAVERSION_KEY, dataValue);
11433
11455
  }
11434
- return (_a = getLocalStorage(DATAVERSION_KEY)) == null ? void 0 : _a.response;
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 };