little-wheels 1.1.21 → 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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  [keyClock登录](/docs/Login.md)
2
2
 
3
+ #### v1.2.0
4
+ 新增 react-hooks
3
5
 
4
6
  #### v1.1.0
5
7
  新增Login模块
@@ -1,5 +1,3 @@
1
- import { default as default_2 } from 'react';
2
-
3
1
  /**
4
2
  * 单点登录(SSO)认证类,封装与身份认证相关的操作
5
3
  *
@@ -10,6 +8,7 @@ import { default as default_2 } from 'react';
10
8
  export declare class AuthLogin {
11
9
  APPID: string;
12
10
  dev: boolean;
11
+ private storage;
13
12
  /**
14
13
  * 构造函数,初始化SSO认证实例
15
14
  * @param {AuthLoginType} config - 认证配置
@@ -70,37 +69,31 @@ export declare class AuthLogin {
70
69
  */
71
70
  refreshToken(forceRefresh?: boolean): Promise<void>;
72
71
  /**
73
- * 静态方法:获取Token信息
74
- * @static
72
+ * 获取Token信息
75
73
  * @returns {TokenInfoType<number>|null} 存储的Token信息
76
- * @throws {Error} APPID未初始化时抛出
77
74
  */
78
- static getTokenInfo(): TokenInfoType<number> | null;
75
+ getTokenInfo(): TokenInfoType<number> | null;
79
76
  /**
80
- * 静态方法:获取Access Token
81
- * @static
77
+ * 获取Access Token
82
78
  * @returns {string|undefined} Access Token
83
79
  */
84
- static getToken(): string | undefined;
80
+ getToken(): string | undefined;
85
81
  /**
86
- * 静态方法:获取Refresh Token
87
- * @static
82
+ * 获取Refresh Token
88
83
  * @returns {string} Refresh Token,不存在时返回空字符串
89
84
  * @throws {Error} APPID未初始化时抛出
90
85
  */
91
- static getRefreshToken(): string;
86
+ getRefreshToken(): string;
92
87
  /**
93
- * 静态方法:解码Token
94
- * @static
88
+ * 解码Token
95
89
  * @returns {DecodeTokenType} 解码后的Token内容
96
90
  */
97
- static getDecodeToken(): DecodeTokenType;
91
+ getDecodeToken(): DecodeTokenType;
98
92
  /**
99
- * 静态方法:清除所有Token
100
- * @static
93
+ * 清除所有Token
101
94
  * @throws {Error} APPID未初始化时抛出
102
95
  */
103
- static removeToken(): void;
96
+ removeToken(): void;
104
97
  }
105
98
 
106
99
  export declare interface AuthLoginType {
@@ -234,10 +227,12 @@ export declare interface ListRes<T> {
234
227
  }
235
228
 
236
229
  export declare class LocalStorageUtil {
237
- static setItem(key: string, value: any): void;
238
- static getItem<T>(key: string): T | null;
239
- static removeItem(key: string): void;
240
- 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;
241
236
  static clearAll(): void;
242
237
  }
243
238
 
@@ -321,21 +316,6 @@ export declare interface TokenInfoType<T> {
321
316
  token_type: "Bearer";
322
317
  }
323
318
 
324
- export declare const Tree: default_2.FC<TreeProps>;
325
-
326
- export declare interface TreeNode {
327
- id: string | number;
328
- name: string;
329
- children?: TreeNode[];
330
- disabled?: boolean;
331
- selected?: boolean;
332
- }
333
-
334
- export declare interface TreeProps {
335
- data: TreeNode[];
336
- onChange?: (node: TreeNode) => void;
337
- }
338
-
339
319
  export declare interface UserDetail {
340
320
  user_name: string;
341
321
  name: string;
@@ -378,7 +358,7 @@ export declare interface UserRoleItem {
378
358
  client_id: any;
379
359
  }
380
360
 
381
- export declare const useSSOApi: () => {
361
+ export declare const useSSOApi: (authLogin: AuthLogin) => {
382
362
  getTokenInfo: (params: SearchTokenParams) => Promise<TokenInfoType<number>>;
383
363
  createPermissionTicket: (data: {
384
364
  client_id: string;