@yeeyoon/library 2.9.1 → 2.9.5

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.
@@ -134,6 +134,7 @@ const Header = (props) => {
134
134
  window.location.href = `${HOST_IAM}?redirect=${origin}${pathname}`;
135
135
  };
136
136
 
137
+ // eslint-disable-next-line no-unused-vars
137
138
  const getCySystemToken = async () => {
138
139
  const resp = await fetchSystemToken({
139
140
  platformId: CY_PLATFORM_ID,
@@ -152,9 +153,9 @@ const Header = (props) => {
152
153
  const { platforms, tenants, id, name } = data;
153
154
  ls.set('X-Auth-Username', name);
154
155
  ls.set('X-Auth-Userid', id);
155
- if (platforms.filter((item) => item.id === CY_PLATFORM_ID).length) {
156
- getCySystemToken();
157
- }
156
+ // if (platforms.filter((item) => item.id === CY_PLATFORM_ID).length) {
157
+ // getCySystemToken();
158
+ // }
158
159
  setUserInfo(data);
159
160
  setPlatforms(platforms);
160
161
  setTenants(tenants);
@@ -15,16 +15,20 @@ const TenantSelector = (props) => {
15
15
  const resp = await fetchUserInfo();
16
16
  const { data, success } = resp;
17
17
  let id;
18
+ let name;
18
19
  if (success) {
19
20
  const { tenants } = data;
20
- if (tenants.filter((item) => item.id === tenantId).length) {
21
+ const result = tenants.filter((item) => item.id === tenantId);
22
+ if (result.length) {
21
23
  id = tenantId;
24
+ name = result[0].name;
22
25
  } else {
23
26
  id = tenants[0].id;
27
+ name = tenants[0].name;
24
28
  }
25
29
  setTenantList(tenants);
26
30
  setCurrentTenantId(id);
27
- tenantIdChangeCb(id);
31
+ tenantIdChangeCb(id, name);
28
32
  }
29
33
  }, []);
30
34
 
@@ -37,9 +41,10 @@ const TenantSelector = (props) => {
37
41
  value={currentTenantId}
38
42
  style={{ width: '215px' }}
39
43
  onChange={(value, option) => {
44
+ const { children } = option;
40
45
  setCurrentTenantId(value);
41
46
  if (tenantIdChangeCb) {
42
- tenantIdChangeCb(value, option);
47
+ tenantIdChangeCb(value, children);
43
48
  }
44
49
  }}
45
50
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeeyoon/library",
3
- "version": "2.9.1",
3
+ "version": "2.9.5",
4
4
  "description": "宜云前端组件库和通用服务",
5
5
  "main": "index.js",
6
6
  "repository": {