little-wheels 1.2.0 → 1.2.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.
package/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@
8
8
  export declare class AuthLogin {
9
9
  APPID: string;
10
10
  dev: boolean;
11
+ private storage;
11
12
  /**
12
13
  * 构造函数,初始化SSO认证实例
13
14
  * @param {AuthLoginType} config - 认证配置
@@ -68,37 +69,31 @@ export declare class AuthLogin {
68
69
  */
69
70
  refreshToken(forceRefresh?: boolean): Promise<void>;
70
71
  /**
71
- * 静态方法:获取Token信息
72
- * @static
72
+ * 获取Token信息
73
73
  * @returns {TokenInfoType<number>|null} 存储的Token信息
74
- * @throws {Error} APPID未初始化时抛出
75
74
  */
76
- static getTokenInfo(): TokenInfoType<number> | null;
75
+ getTokenInfo(): TokenInfoType<number> | null;
77
76
  /**
78
- * 静态方法:获取Access Token
79
- * @static
77
+ * 获取Access Token
80
78
  * @returns {string|undefined} Access Token
81
79
  */
82
- static getToken(): string | undefined;
80
+ getToken(): string | undefined;
83
81
  /**
84
- * 静态方法:获取Refresh Token
85
- * @static
82
+ * 获取Refresh Token
86
83
  * @returns {string} Refresh Token,不存在时返回空字符串
87
84
  * @throws {Error} APPID未初始化时抛出
88
85
  */
89
- static getRefreshToken(): string;
86
+ getRefreshToken(): string;
90
87
  /**
91
- * 静态方法:解码Token
92
- * @static
88
+ * 解码Token
93
89
  * @returns {DecodeTokenType} 解码后的Token内容
94
90
  */
95
- static getDecodeToken(): DecodeTokenType;
91
+ getDecodeToken(): DecodeTokenType;
96
92
  /**
97
- * 静态方法:清除所有Token
98
- * @static
93
+ * 清除所有Token
99
94
  * @throws {Error} APPID未初始化时抛出
100
95
  */
101
- static removeToken(): void;
96
+ removeToken(): void;
102
97
  }
103
98
 
104
99
  export declare interface AuthLoginType {
@@ -232,10 +227,12 @@ export declare interface ListRes<T> {
232
227
  }
233
228
 
234
229
  export declare class LocalStorageUtil {
235
- static setItem(key: string, value: any): void;
236
- static getItem<T>(key: string): T | null;
237
- static removeItem(key: string): void;
238
- static clear(): void;
230
+ private appId;
231
+ constructor(appId: string);
232
+ setItem(key: string, value: any): void;
233
+ getItem<T>(key: string): T | null;
234
+ removeItem(key: string): void;
235
+ clear(): void;
239
236
  static clearAll(): void;
240
237
  }
241
238
 
@@ -361,7 +358,7 @@ export declare interface UserRoleItem {
361
358
  client_id: any;
362
359
  }
363
360
 
364
- export declare const useSSOApi: () => {
361
+ export declare const useSSOApi: (authLogin: AuthLogin) => {
365
362
  getTokenInfo: (params: SearchTokenParams) => Promise<TokenInfoType<number>>;
366
363
  createPermissionTicket: (data: {
367
364
  client_id: string;