ls-pro-common 3.1.39 → 3.1.40

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.
@@ -189,4 +189,5 @@ declare const mdmMap: {
189
189
  };
190
190
  export declare type MdmType = keyof typeof mdmMap;
191
191
  export declare const getMdmData: (type: MdmType, params?: any) => Promise<any>;
192
+ export declare const clearMdmCache: () => void;
192
193
  export {};
@@ -381,4 +381,12 @@ export var getMdmData = function getMdmData(type) {
381
381
  throw new Error("".concat(type, " \u4E0D\u5B58\u5728"));
382
382
  }
383
383
  return fn(params);
384
+ };
385
+ export var clearMdmCache = function clearMdmCache() {
386
+ // 清空所有 mdm- 开头的缓存
387
+ Object.keys(sessionStorage).forEach(function (key) {
388
+ if (key.startsWith('mdm-')) {
389
+ sessionStorage.removeItem(key);
390
+ }
391
+ });
384
392
  };
@@ -189,4 +189,5 @@ declare const mdmMap: {
189
189
  };
190
190
  export declare type MdmType = keyof typeof mdmMap;
191
191
  export declare const getMdmData: (type: MdmType, params?: any) => Promise<any>;
192
+ export declare const clearMdmCache: () => void;
192
193
  export {};
@@ -381,4 +381,12 @@ export var getMdmData = function getMdmData(type) {
381
381
  throw new Error("".concat(type, " \u4E0D\u5B58\u5728"));
382
382
  }
383
383
  return fn(params);
384
+ };
385
+ export var clearMdmCache = function clearMdmCache() {
386
+ // 清空所有 mdm- 开头的缓存
387
+ Object.keys(sessionStorage).forEach(function (key) {
388
+ if (key.startsWith('mdm-')) {
389
+ sessionStorage.removeItem(key);
390
+ }
391
+ });
384
392
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ls-pro-common",
3
- "version": "3.1.39",
3
+ "version": "3.1.40",
4
4
  "description": "ls-pro-common",
5
5
  "license": "MIT",
6
6
  "sideEffects": [