module-menu 0.3.30 → 0.3.32
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/config/config.js +3 -3
- package/package.json +1 -1
- package/src/.umi/.cache/babel-loader/252180f984fc6d62c4132af18867c467.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/2be46f65e3333a35a861fee8be0bd431.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/66c8651c57d04bb7b8127ce1445ad081.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/a683f99c5db42fba164bf01e7c59ea33.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/c01232eea19e3f5d5e103f47da18b735.json.gz +0 -0
- package/src/pages/ModuleUser/index.jsx +110 -40
- package/src/pages/index.jsx +2 -14
- package/src/pages/util/axios.js +1 -1
package/config/config.js
CHANGED
|
@@ -5,7 +5,7 @@ module.exports = defineConfig({
|
|
|
5
5
|
// localhost:8000/cmcc/data/** -> http://192.168.108.88:30808/cmcc/data/**
|
|
6
6
|
'/cmcc/data/': {
|
|
7
7
|
// 要代理的地址
|
|
8
|
-
target: 'https://192.168.108.
|
|
8
|
+
target: 'https://192.168.108.203:31950',
|
|
9
9
|
// target: 'http://10.136.106.82:30808',
|
|
10
10
|
// target: 'http://192.168.200.122:28088',
|
|
11
11
|
// target: 'http://10.136.106.148:32678',
|
|
@@ -17,7 +17,7 @@ module.exports = defineConfig({
|
|
|
17
17
|
},
|
|
18
18
|
'/admin/': {
|
|
19
19
|
// 要代理的地址
|
|
20
|
-
target: 'https://192.168.108.
|
|
20
|
+
target: 'https://192.168.108.203:31950',
|
|
21
21
|
// target: 'http://10.136.106.82:30808',
|
|
22
22
|
// target: 'http://192.168.200.122:28088',
|
|
23
23
|
// target: 'http://10.136.106.148:32678',
|
|
@@ -29,7 +29,7 @@ module.exports = defineConfig({
|
|
|
29
29
|
},
|
|
30
30
|
'/admin-api/': {
|
|
31
31
|
// 要代理的地址
|
|
32
|
-
target: 'https://192.168.108.
|
|
32
|
+
target: 'https://192.168.108.203:31950',
|
|
33
33
|
// target: 'http://10.136.106.82:30808',
|
|
34
34
|
// target: 'http://192.168.200.122:28088',
|
|
35
35
|
// target: 'http://10.136.106.148:32678',
|
package/package.json
CHANGED
|
@@ -12,16 +12,20 @@ import Axios from '../util/axios';
|
|
|
12
12
|
import getStore, { getUserName } from '../util/userInfo';
|
|
13
13
|
import { getLoginUrl } from '../util/permessionUtils';
|
|
14
14
|
import './index.less';
|
|
15
|
-
import cn from 'classnames'
|
|
15
|
+
import cn from 'classnames';
|
|
16
16
|
import userLogo1 from '../../assets/userLogo1.png';
|
|
17
17
|
|
|
18
18
|
// stash存在则为一体化,否则为轻量级
|
|
19
|
-
const ModuleUser = ({
|
|
19
|
+
const ModuleUser = ({
|
|
20
|
+
stash = '',
|
|
21
|
+
isBigDataFoundationPlatform = false,
|
|
22
|
+
PZCS = false,
|
|
23
|
+
}) => {
|
|
20
24
|
const [tenantList, setTenantList] = useState([]);
|
|
21
25
|
const [haveAppSystemPermission, setHaveAppSystemPermission] = useState(false);
|
|
22
26
|
const [getSystemPermission, setGetSystemPermission] = useState(false);
|
|
23
27
|
useEffect(() => {
|
|
24
|
-
localStorage.setItem('stash', stash)
|
|
28
|
+
localStorage.setItem('stash', stash);
|
|
25
29
|
if (['integration', 'LNRD', 'HBJK'].includes(stash)) {
|
|
26
30
|
getTenantList();
|
|
27
31
|
allSystemList();
|
|
@@ -32,7 +36,7 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
32
36
|
window.location.href = url;
|
|
33
37
|
};
|
|
34
38
|
const handleClickSysManage = () => {
|
|
35
|
-
if(['
|
|
39
|
+
if (['LNRD', 'HBJK'].includes(stash)) {
|
|
36
40
|
Axios('get', '/admin-api/system/auth/homePage', '', {})
|
|
37
41
|
.then((res) => {
|
|
38
42
|
if (res.data.code === 0) {
|
|
@@ -42,10 +46,24 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
42
46
|
}
|
|
43
47
|
})
|
|
44
48
|
.catch((e) => console.log('e', e));
|
|
45
|
-
}else{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
} else if (stash === 'integration') {
|
|
50
|
+
Axios('get', '/admin-api/system/auth/systemPage', '', {})
|
|
51
|
+
.then((res) => {
|
|
52
|
+
if (res.data.code === 0) {
|
|
53
|
+
window.location.href = `/admin-ui${res.data.data.path}`;
|
|
54
|
+
} else {
|
|
55
|
+
message.warning(res.data.msg || '获取系统管理页面路由信息失败');
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
.catch((e) => console.log('e', e));
|
|
59
|
+
} else {
|
|
60
|
+
const menuList = getStore({ name: 'menu' });
|
|
61
|
+
const sysManagePath = menuList?.find((item) => item.name === '权限管理')
|
|
62
|
+
.children[0].path;
|
|
63
|
+
window.location.href =
|
|
64
|
+
stash === 'GZW'
|
|
65
|
+
? '/data-platform/#' + sysManagePath
|
|
66
|
+
: '/#' + sysManagePath;
|
|
49
67
|
}
|
|
50
68
|
};
|
|
51
69
|
const {
|
|
@@ -56,10 +74,16 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
56
74
|
AppSystemSrc,
|
|
57
75
|
} = userMenuIcon;
|
|
58
76
|
|
|
59
|
-
const isHaveSystemManagementPermission =
|
|
60
|
-
? true
|
|
77
|
+
const isHaveSystemManagementPermission = ['LNRD', 'HBJK'].includes(stash)
|
|
78
|
+
? true
|
|
79
|
+
: stash === 'integration'
|
|
80
|
+
? getSystemPermission
|
|
61
81
|
: getStore({ name: 'isHaveSystemManagementPermission' });
|
|
62
|
-
const DEFAULT_LOGOUT_URL =
|
|
82
|
+
const DEFAULT_LOGOUT_URL = ['integration', 'LNRD', 'HBJK'].includes(stash)
|
|
83
|
+
? '/admin-ui/login'
|
|
84
|
+
: stash === 'GZW'
|
|
85
|
+
? '/data-platform/#/login'
|
|
86
|
+
: '/#/login';
|
|
63
87
|
|
|
64
88
|
// 跳转服务门户
|
|
65
89
|
const jumpToExterHome = () => {
|
|
@@ -69,7 +93,9 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
69
93
|
const curTenantId = ['integration', 'LNRD', 'HBJK'].includes(stash)
|
|
70
94
|
? getStore({ name: 'tenantId' }) && parseInt(getStore({ name: 'tenantId' }))
|
|
71
95
|
: '';
|
|
72
|
-
const curTenantName = ['integration', 'LNRD', 'HBJK'].includes(stash)
|
|
96
|
+
const curTenantName = ['integration', 'LNRD', 'HBJK'].includes(stash)
|
|
97
|
+
? getStore({ name: 'tenantName' })
|
|
98
|
+
: '';
|
|
73
99
|
|
|
74
100
|
const getTenantList = () => {
|
|
75
101
|
Axios('get', '/admin-api/system/user/getUserTenant', '', {})
|
|
@@ -108,7 +134,7 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
108
134
|
};
|
|
109
135
|
});
|
|
110
136
|
let haveAppSystem_Permission =
|
|
111
|
-
menuGet?.some((item) => item.name === '
|
|
137
|
+
menuGet?.some((item) => item.name === '数据源管理') || false;
|
|
112
138
|
setHaveAppSystemPermission(haveAppSystem_Permission);
|
|
113
139
|
}
|
|
114
140
|
})
|
|
@@ -138,14 +164,18 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
138
164
|
}
|
|
139
165
|
})
|
|
140
166
|
.catch((e) => console.log('e', e));
|
|
141
|
-
}
|
|
167
|
+
};
|
|
142
168
|
|
|
143
169
|
// 退出登录
|
|
144
170
|
const logout = () => {
|
|
145
|
-
|
|
171
|
+
const logoutUrl = ['integration', 'LNRD', 'HBJK'].includes(stash)
|
|
146
172
|
? '/admin-api/system/auth/logout'
|
|
147
|
-
:
|
|
148
|
-
|
|
173
|
+
: stash === 'GZW'
|
|
174
|
+
? '/data-platform/auth/token/logout'
|
|
175
|
+
: '/auth/token/logout';
|
|
176
|
+
const logouType = ['integration', 'LNRD', 'HBJK'].includes(stash)
|
|
177
|
+
? 'post'
|
|
178
|
+
: 'delete';
|
|
149
179
|
Axios(logouType, logoutUrl, '', {})
|
|
150
180
|
.then(() => {
|
|
151
181
|
console.log('退出登录接口调用成功');
|
|
@@ -158,7 +188,9 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
158
188
|
console.log('Login URL found:', res.data.data.loginoutUrl);
|
|
159
189
|
window.location.href = res.data.data.loginoutUrl;
|
|
160
190
|
} else {
|
|
161
|
-
console.log(
|
|
191
|
+
console.log(
|
|
192
|
+
'No login URL found, redirect to default login page.',
|
|
193
|
+
);
|
|
162
194
|
window.location.href = '/admin-ui/login';
|
|
163
195
|
}
|
|
164
196
|
})
|
|
@@ -206,9 +238,11 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
206
238
|
handleClickmenu(
|
|
207
239
|
isBigDataFoundationPlatform
|
|
208
240
|
? '/admin-ui/user/profile'
|
|
209
|
-
:
|
|
210
|
-
|
|
211
|
-
|
|
241
|
+
: ['integration', 'LNRD', 'HBJK'].includes(stash)
|
|
242
|
+
? '/admin-ui/data-share-portal/personal/info'
|
|
243
|
+
: stash === 'GZW'
|
|
244
|
+
? '/data-platform/#/info/index'
|
|
245
|
+
: '/#/info/index',
|
|
212
246
|
)
|
|
213
247
|
}
|
|
214
248
|
>
|
|
@@ -217,7 +251,11 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
217
251
|
alt=""
|
|
218
252
|
style={{ marginRight: '10px', marginTop: '-3px' }}
|
|
219
253
|
/>
|
|
220
|
-
<span>
|
|
254
|
+
<span>
|
|
255
|
+
{['integration', 'LNRD', 'HBJK'].includes(stash)
|
|
256
|
+
? '用户中心'
|
|
257
|
+
: '个人中心'}
|
|
258
|
+
</span>
|
|
221
259
|
</Menu.Item>
|
|
222
260
|
{isHaveSystemManagementPermission && (
|
|
223
261
|
<Menu.Item key="systemManage" onClick={handleClickSysManage}>
|
|
@@ -232,14 +270,20 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
232
270
|
{haveAppSystemPermission && (
|
|
233
271
|
<Menu.Item
|
|
234
272
|
key="appSystem"
|
|
235
|
-
onClick={() =>
|
|
273
|
+
onClick={() =>
|
|
274
|
+
handleClickmenu(
|
|
275
|
+
PZCS
|
|
276
|
+
? '/dataadmin/#/appManager/index'
|
|
277
|
+
: '/dataadmin/#/appSystem/index',
|
|
278
|
+
)
|
|
279
|
+
}
|
|
236
280
|
>
|
|
237
281
|
<img
|
|
238
282
|
src={AppSystemSrc}
|
|
239
283
|
alt=""
|
|
240
284
|
style={{ marginRight: '10px', marginTop: '-3px' }}
|
|
241
285
|
/>
|
|
242
|
-
<span
|
|
286
|
+
<span>数据源管理</span>
|
|
243
287
|
</Menu.Item>
|
|
244
288
|
)}
|
|
245
289
|
<Menu.Item key="logout" onClick={() => logout()}>
|
|
@@ -254,29 +298,51 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
254
298
|
);
|
|
255
299
|
|
|
256
300
|
return (
|
|
257
|
-
<div
|
|
301
|
+
<div
|
|
302
|
+
className={cn(
|
|
303
|
+
stash !== 'LNRD' ? 'right_size' : 'right_size_LNRD',
|
|
304
|
+
'right',
|
|
305
|
+
)}
|
|
306
|
+
>
|
|
258
307
|
{['integration', 'LNRD', 'HBJK'].includes(stash) && [
|
|
259
308
|
!isBigDataFoundationPlatform && !PZCS && (
|
|
260
|
-
<Button
|
|
261
|
-
|
|
309
|
+
<Button
|
|
310
|
+
type="link"
|
|
311
|
+
onClick={jumpToExterHome}
|
|
312
|
+
className={cn(
|
|
313
|
+
stash === 'LNRD'
|
|
314
|
+
? 'fwmh_color_LNRD'
|
|
315
|
+
: stash === 'HBJK'
|
|
316
|
+
? 'fwmh_color_HBJK'
|
|
317
|
+
: null,
|
|
318
|
+
)}
|
|
319
|
+
>
|
|
262
320
|
服务门户
|
|
263
321
|
</Button>
|
|
264
322
|
),
|
|
265
|
-
!PZCS &&
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
323
|
+
!PZCS && (
|
|
324
|
+
<Select
|
|
325
|
+
defaultValue={curTenantId}
|
|
326
|
+
className={
|
|
327
|
+
stash === 'LNRD'
|
|
328
|
+
? 'right-select_LNRD'
|
|
329
|
+
: stash === 'HBJK'
|
|
330
|
+
? 'right-select_HBJK'
|
|
331
|
+
: 'right-select'
|
|
332
|
+
}
|
|
333
|
+
style={{
|
|
334
|
+
width: 150,
|
|
335
|
+
border: 'none',
|
|
336
|
+
}}
|
|
337
|
+
onChange={handleChangeTenant}
|
|
338
|
+
options={tenantList}
|
|
339
|
+
/>
|
|
340
|
+
),
|
|
275
341
|
]}
|
|
276
342
|
{getUserName() ? (
|
|
277
343
|
<HeaderDropdown overlay={menu}>
|
|
278
344
|
<span style={{ display: 'inline-block', marginLeft: '12px' }}>
|
|
279
|
-
|
|
345
|
+
{stash === 'HBJK' ? (
|
|
280
346
|
<Avatar size="small" src={userLogo1} />
|
|
281
347
|
) : (
|
|
282
348
|
<Avatar size="small" icon={<UserOutlined />} />
|
|
@@ -288,13 +354,17 @@ const ModuleUser = ({ stash = '', isBigDataFoundationPlatform = false, PZCS = fa
|
|
|
288
354
|
fontSize: '16px',
|
|
289
355
|
fontWeight: '500',
|
|
290
356
|
// color: stash !== 'LNRD'? null: '#FFFFFF'
|
|
291
|
-
color: ['LNRD','HBJK'].includes(stash)? '#FFFFFF' : null
|
|
357
|
+
color: ['LNRD', 'HBJK'].includes(stash) ? '#FFFFFF' : null,
|
|
292
358
|
}}
|
|
293
359
|
>
|
|
294
360
|
{getUserName()}
|
|
295
361
|
</span>
|
|
296
362
|
<CaretDownOutlined
|
|
297
|
-
style={{
|
|
363
|
+
style={{
|
|
364
|
+
marginLeft: '10px',
|
|
365
|
+
fontSize: '8px',
|
|
366
|
+
color: ['LNRD', 'HBJK'].includes(stash) ? '#FFFFFF' : '#333333',
|
|
367
|
+
}}
|
|
298
368
|
/>
|
|
299
369
|
</span>
|
|
300
370
|
</HeaderDropdown>
|
package/src/pages/index.jsx
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import ModuleMenu from './ModuleMenu';
|
|
2
2
|
import ModuleUser from './ModuleUser';
|
|
3
3
|
import Footer from './Footer';
|
|
4
|
-
|
|
5
4
|
export { ModuleMenu, ModuleUser, Footer };
|
|
6
|
-
|
|
7
|
-
export default
|
|
8
|
-
return (
|
|
9
|
-
<div>
|
|
10
|
-
<ModuleMenu stash="integration" />
|
|
11
|
-
<ModuleUser stash="integration" PZCS={true} />
|
|
12
|
-
<div style={{ padding: '50px', marginTop: '100px' }}>
|
|
13
|
-
<h1>测试页面</h1>
|
|
14
|
-
<p>ModuleMenu 组件已加载</p>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
5
|
+
// 开发环境,手动打开,并且屏蔽上面的导出
|
|
6
|
+
// export default ModuleMenu;
|
package/src/pages/util/axios.js
CHANGED
|
@@ -5,7 +5,7 @@ import getStore from './userInfo';
|
|
|
5
5
|
import { checkToken } from './permessionUtils';
|
|
6
6
|
import CONSTANT from './constant';
|
|
7
7
|
|
|
8
|
-
let tokenValue = '
|
|
8
|
+
let tokenValue = '5de3ef8171364d6ba756221655fe1310';
|
|
9
9
|
// 轻量级tokenInSessionStor存在(GZW跳/data-platform/#/login,否则/#/login),一体化tokenInSessionStor不存在
|
|
10
10
|
const tokenInSessionStor = window.sessionStorage.getItem(
|
|
11
11
|
'bigdata-access_token',
|