@yeeyoon/library 3.5.1 → 3.5.4

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.
@@ -12,7 +12,13 @@ import {
12
12
  import ProductListMenu from './components/ProductListMenu/';
13
13
  import PlatformModal from './components/PlatformModal/';
14
14
 
15
- import { IconTodo, IconConsole, IconMore, IconQunZuGuanLi } from '../Icons/';
15
+ import {
16
+ IconTodo,
17
+ IconConsole,
18
+ IconMore,
19
+ IconQunZuGuanLi,
20
+ IconVersion,
21
+ } from '../Icons/';
16
22
 
17
23
  import {
18
24
  fetchSystemToken,
@@ -28,6 +34,8 @@ import {
28
34
  HOST_PROFILE_USER,
29
35
  HOST_PROFILE_PASSWORD,
30
36
  HOST_PROFILE_GROUP,
37
+ HOST_HUASHAN_LOGIN,
38
+ HOST_HUASHAN_BPM,
31
39
  } from '../../config/env';
32
40
 
33
41
  import LogoProfile from './assets/profile.svg';
@@ -134,7 +142,11 @@ const Header = (props) => {
134
142
 
135
143
  const backToIam = () => {
136
144
  const { origin, pathname } = window.location;
137
- window.location.href = `${HOST_IAM}?redirect=${origin}${pathname}`;
145
+ if (origin.indexOf(HOST_HUASHAN_BPM) > -1) {
146
+ window.location.href = HOST_HUASHAN_LOGIN;
147
+ } else {
148
+ window.location.href = `${HOST_IAM}?redirect=${origin}${pathname}`;
149
+ }
138
150
  };
139
151
 
140
152
  // eslint-disable-next-line no-unused-vars
@@ -219,7 +231,7 @@ const Header = (props) => {
219
231
  case 'bpm-share':
220
232
  return {
221
233
  logo: LogoBpm,
222
- name: '周转物资系统管理平台',
234
+ name: '周转物资协同管理平台',
223
235
  };
224
236
  case 'mms':
225
237
  return {
@@ -292,6 +304,26 @@ const Header = (props) => {
292
304
  <IconTodo style={IconStyle} />
293
305
  任务中心
294
306
  </span>
307
+ {(productName === 'bpm' || productName === 'mms') && (
308
+ <span
309
+ className={styles['comp-header__icon']}
310
+ onClick={() => {
311
+ let system = '';
312
+ switch (productName) {
313
+ case 'bpm':
314
+ system = 'bpm';
315
+ break;
316
+ case 'mms':
317
+ system = 'wms';
318
+ break;
319
+ }
320
+ window.location.href = `${HOST_OFFICIAL}/version?system=${system}&token=${token}`;
321
+ }}
322
+ >
323
+ <IconVersion style={IconStyle} />
324
+ 版本中心
325
+ </span>
326
+ )}
295
327
  {/* {systemUserInfo && (
296
328
  <Notification
297
329
  customStyles={{
@@ -7,6 +7,7 @@ const Icons = createFromIconfontCN({
7
7
  '//at.alicdn.com/t/font_2832661_kmrn4o901g.js', //宜云协同iconfont
8
8
  '//at.alicdn.com/t/font_2832313_vjeg45f5qof.js',
9
9
  '//at.alicdn.com/t/font_2965204_9g0wekoduag.js', //租户管理
10
+ '//at.alicdn.com/t/font_3133477_q292mp6e2u.js',
10
11
  ],
11
12
  });
12
13
 
@@ -34,6 +35,9 @@ const IconTuijianchanpin = (args) => {
34
35
  const IconQunZuGuanLi = (args) => {
35
36
  return <Icons type="icon-qunzuguanli" {...args} />;
36
37
  };
38
+ const IconVersion = (args) => {
39
+ return <Icons type="icon-tag" {...args} />;
40
+ };
37
41
 
38
42
  export {
39
43
  IconBell,
@@ -44,4 +48,5 @@ export {
44
48
  IconWodechanpin,
45
49
  IconTuijianchanpin,
46
50
  IconQunZuGuanLi,
51
+ IconVersion,
47
52
  };
package/lib/config/env.js CHANGED
@@ -91,6 +91,16 @@ function getEnvHost(product, path = '') {
91
91
  }
92
92
  }
93
93
 
94
+ function getHuashanEnvHost(isLogin = false) {
95
+ if (REACT_APP_ENV === 'prod') {
96
+ if (isLogin) return 'https://huashan-login.yeeyoon.com';
97
+ else return 'https://huashan.yeeyoon.com';
98
+ } else {
99
+ if (isLogin) return 'https://testing-huashan-login.yeeyoon.com';
100
+ else return 'https://testing-huashan.yeeyoon.com';
101
+ }
102
+ }
103
+
94
104
  function getEnvApi(product, path = '') {
95
105
  const env = REACT_APP_ENV === 'dev' ? 'testing' : REACT_APP_ENV;
96
106
  const api = envApi[product][env];
@@ -128,6 +138,9 @@ export const HOST_PROFILE_GROUP = getEnvHost('profile', '/user-profile/group');
128
138
  export const HOST_ZHONGTAI_XLT = getEnvHost('zhongtai_cy');
129
139
  export const HOST_ZHONGTAI_CY = getEnvHost('zhongtai_xlt');
130
140
 
141
+ export const HOST_HUASHAN_LOGIN = `${getHuashanEnvHost(true)}/login`;
142
+ export const HOST_HUASHAN_BPM = getHuashanEnvHost();
143
+
131
144
  // API
132
145
  export const API_IAM = getEnvApi('iam');
133
146
  export const API_ZHONGTAI_CY = getEnvApi('zhongtai_cy');
@@ -149,6 +162,8 @@ console.log(
149
162
  `HOST_PROFILE_MESSAGE: ${HOST_PROFILE_MESSAGE}\n`,
150
163
  `HOST_ZHONGTAI_XLT: ${HOST_ZHONGTAI_XLT}\n`,
151
164
  `HOST_ZHONGTAI_CY: ${HOST_ZHONGTAI_CY}\n`,
165
+ `HOST_HUASHAN_LOGIN: ${HOST_HUASHAN_LOGIN}\n`,
166
+ `HOST_HUASHAN_BPM: ${HOST_HUASHAN_BPM}\n`,
152
167
  `------------------------------------\n`,
153
168
  `API_IAM: ${API_IAM}\n`,
154
169
  `API_ZHONGTAI_CY: ${API_ZHONGTAI_CY}\n`,
@@ -44,7 +44,11 @@ rest && ls.set(REST_KEY, JSON.stringify(rest));
44
44
 
45
45
  const backToIam = () => {
46
46
  const { origin, pathname } = window.location;
47
- window.location.href = `${HOST_IAM}?redirect=${origin}${pathname}`;
47
+ if (origin.indexOf('huashan') > -1) {
48
+ window.location.href = 'https://testing-huashan-login.yeeyoon.com/login';
49
+ } else {
50
+ window.location.href = `${HOST_IAM}?redirect=${origin}${pathname}`;
51
+ }
48
52
  };
49
53
 
50
54
  const errorHandler = (error) => {
@@ -78,36 +82,39 @@ const request = extend({
78
82
  },
79
83
  });
80
84
 
81
- request.interceptors.response.use(async (response) => {
82
- const resp = await response.clone().json();
83
- const { data, code, message, msg, errormsg, success } = resp;
84
- if (!data && !code && !message && !msg && !errormsg && !success) {
85
- return response;
86
- }
87
- const m = msg || message || errormsg;
88
- if (code !== 200 && code !== 201 && !success) {
89
- m !== '操作过于频繁' &&
90
- m.indexOf('存在重复的物资') < 0 &&
91
- notification.error({
92
- message: m,
93
- maxCount: 1,
94
- });
95
- if (
96
- code === 401 ||
97
- code === 402 ||
98
- m === 'token验证失败' ||
99
- m === 'token不一致'
100
- ) {
101
- window.top.postMessage('tcTokenExpired', '*'); // 通知宿主窗口
102
- setTimeout(() => {
103
- backToIam();
104
- }, 1000);
85
+ request.interceptors.response.use(
86
+ async (response) => {
87
+ const resp = await response.clone().json();
88
+ const { data, code, message, msg, errormsg, success } = resp;
89
+ if (!data && !code && !message && !msg && !errormsg && !success) {
90
+ return response;
105
91
  }
106
- return resp;
107
- } else if (success && (!code || code === 200)) {
108
- return resp;
109
- }
110
- return data;
111
- }, { global: false });
92
+ const m = msg || message || errormsg;
93
+ if (code !== 200 && code !== 201 && !success) {
94
+ m !== '操作过于频繁' &&
95
+ m.indexOf('存在重复的物资') < 0 &&
96
+ notification.error({
97
+ message: m,
98
+ maxCount: 1,
99
+ });
100
+ if (
101
+ code === 401 ||
102
+ code === 402 ||
103
+ m === 'token验证失败' ||
104
+ m === 'token不一致'
105
+ ) {
106
+ window.top.postMessage('tcTokenExpired', '*'); // 通知宿主窗口
107
+ setTimeout(() => {
108
+ backToIam();
109
+ }, 1000);
110
+ }
111
+ return resp;
112
+ } else if (success && (!code || code === 200)) {
113
+ return resp;
114
+ }
115
+ return data;
116
+ },
117
+ { global: false }
118
+ );
112
119
 
113
120
  export default request;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeeyoon/library",
3
- "version": "3.5.1",
3
+ "version": "3.5.4",
4
4
  "description": "宜云前端组件库和通用服务",
5
5
  "main": "index.js",
6
6
  "repository": {
package/src/global.css CHANGED
@@ -4,7 +4,7 @@ html, body, #root {
4
4
 
5
5
  body {
6
6
  margin: 0;
7
- /* background-color: #000 !important; */
7
+ background-color: #000 !important;
8
8
  }
9
9
 
10
10
  body * {