xframelib 0.6.0 → 0.6.1

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.
@@ -2,6 +2,10 @@
2
2
  * 刷新提前量(毫秒,ms)
3
3
  */
4
4
  export declare const TOKEN_REFRESH_TIME: number;
5
+ /**
6
+ * 默认的Token最大有效间隔时间,60分钟,60*60*1000
7
+ */
8
+ export declare const TOKEN_VALID_TIMESPAN: number;
5
9
  /**
6
10
  * 用户和Token相关服务API
7
11
  */
@@ -10,7 +10,7 @@ declare class StorageHelper {
10
10
  * @description 设置缓存
11
11
  * @param {string} key 缓存键
12
12
  * @param {*} value 缓存值
13
- * @param expire
13
+ * @param expire 超时时间为秒
14
14
  */
15
15
  set(key: string, value: any, expire?: number | null): void;
16
16
  /**
@@ -19,6 +19,15 @@ declare class StorageHelper {
19
19
  * @param {*=} def 默认值
20
20
  */
21
21
  get(key: string, def?: any): any;
22
+ /**
23
+ * 获取存储对象,带expire属性
24
+ * 返回:
25
+ * {
26
+ * value:any,
27
+ * expire:null|Time
28
+ * }
29
+ */
30
+ getJsonObject(key: string): any;
22
31
  /**
23
32
  * 从缓存删除某项
24
33
  * @param {string} key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xframelib",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "积累的前端开发基础库",
5
5
  "main": "dist/index.js",
6
6
  "common": "dist/index.cjs",
@@ -26,11 +26,11 @@
26
26
  "@hprose/io": "^3.0.10",
27
27
  "@hprose/rpc-core": "^3.0.10",
28
28
  "@hprose/rpc-html5": "^3.0.10",
29
+ "axios": "^0.26.1",
29
30
  "localforage": "^1.10.0",
30
31
  "spark-md5": "^3.0.2",
31
32
  "streamsaver": "^2.0.6",
32
- "xhr": "^2.6.0",
33
- "axios": "^0.26.1"
33
+ "xhr": "^2.6.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@rollup/plugin-alias": "^3.1.9",