little-wheels 1.2.11 → 1.2.13

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,10 +1,45 @@
1
1
  [keyClock登录](/docs/Login.md)
2
2
 
3
+ #### v1.2.12
4
+ - 修复登出时缺少 `id_token` 导致的问题
5
+
6
+ #### v1.2.11
7
+ - 修复独立鉴权模式下的 401 响应处理
8
+
9
+ #### v1.2.10
10
+ - 新增 `setTokenStr` 方法用于仅设置 Access Token
11
+ - 更新 `.npmrc` 配置文件
12
+
13
+ #### v1.2.9
14
+ - 修复 SSO 用户组类型判断逻辑
15
+
16
+ #### v1.2.8
17
+ - 修复 SSO 登录分组数据匹配失败时返回 `null`
18
+ - 添加 `.npmrc` 配置文件
19
+
20
+ #### v1.2.7
21
+ - 添加根据 `groupId` 获取分公司信息的方法
22
+
23
+ #### v1.2.6
24
+ - 支持传入初始 `token` 参数
25
+
26
+ #### v1.2.5
27
+ - 支持自定义基础 URL 配置
28
+
29
+ #### v1.2.4
30
+ - 将请求参数从 body 移动到 URL 查询字符串
31
+
32
+ #### v1.2.3
33
+ - 更新用户组列表接口地址
34
+
35
+ #### v1.2.2
36
+ - 支持 TypeScript 类型导出声明
37
+
3
38
  #### v1.2.1
4
- Login 模块移除所有静态方法,调用方式发生变化
39
+ - Login 模块移除所有静态方法,调用方式发生变化
5
40
 
6
41
  #### v1.2.0
7
- 新增 react-hooks
42
+ - 新增 react-hooks
8
43
 
9
44
  #### v1.1.0
10
- 新增Login模块
45
+ - 新增 Login 模块
package/dist/index.d.ts CHANGED
@@ -388,7 +388,7 @@ export declare const useSSOApi: (authLogin: AuthLogin) => {
388
388
  grant_type: string;
389
389
  ticket: string;
390
390
  }) => Promise<TokenInfoType<number>>;
391
- refreshAuthToken: () => Promise<TokenInfoType<number>>;
391
+ refreshAuthToken: (refreshToken?: string) => Promise<TokenInfoType<number>>;
392
392
  getCompanyList: () => Promise<CompanyItem[]>;
393
393
  getUserGroupList: () => Promise<UserGroupItem[]>;
394
394
  getUserInfo: () => Promise<UserInfo>;
package/dist/index.es.js CHANGED
@@ -1672,10 +1672,10 @@ const ie = (r) => ({
1672
1672
  }
1673
1673
  });
1674
1674
  },
1675
- refreshAuthToken: () => U(r, `${G.refreshToken}`, {
1675
+ refreshAuthToken: (e) => U(r, `${G.refreshToken}`, {
1676
1676
  headers: {
1677
1677
  "Content-Type": "application/json",
1678
- Authorization: "Bearer " + r.getRefreshToken()
1678
+ Authorization: "Bearer " + (e || r.getRefreshToken())
1679
1679
  }
1680
1680
  }),
1681
1681
  getCompanyList: () => U(r, `${G.allCompany}`, {}),
@@ -1934,7 +1934,10 @@ class Jn {
1934
1934
  */
1935
1935
  logout() {
1936
1936
  const { href: e, origin: t } = window.location, { id_token: a } = this.getTokenInfo() || {};
1937
- this.storage.removeItem("login_redirect_uri");
1937
+ if (this.storage.removeItem("login_redirect_uri"), !a) {
1938
+ this.login();
1939
+ return;
1940
+ }
1938
1941
  const s = {
1939
1942
  id_token_hint: a,
1940
1943
  post_logout_redirect_uri: e
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "little-wheels",
3
- "version": "1.2.11",
3
+ "version": "1.2.13",
4
4
  "description": "这是一个基于react自用轮子库",
5
5
  "repository": {
6
6
  "type": "git",