module-menu 0.1.36 → 0.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/dist/index.html +22 -0
- package/dist/static/admin_logo.436045b7.svg +48 -0
- package/dist/static/admin_slogo.cc12b7d8.svg +48 -0
- package/dist/static/alert_logo.461428a2.svg +26 -0
- package/dist/static/alert_slogo.d7000af9.svg +26 -0
- package/dist/static/dataManager_logo.e27b3137.svg +42 -0
- package/dist/static/dataanalytic_logo.76dd2fda.svg +44 -0
- package/dist/static/dataanalytic_slogo.69fa2eee.svg +47 -0
- package/dist/static/dataasset_logo.9f1e48b2.svg +52 -0
- package/dist/static/dataasset_slogo.84d16e23.svg +52 -0
- package/dist/static/datacollection_logo.348102ed.svg +70 -0
- package/dist/static/datacollection_slogo.743ac405.svg +70 -0
- package/dist/static/datadev_logo.e57f9325.svg +26 -0
- package/dist/static/datadev_slogo.db9ce68f.svg +26 -0
- package/dist/static/datalabel_slogo.62e8f571.svg +26 -0
- package/dist/static/datamanager_slogo.8028bc5f.svg +42 -0
- package/dist/static/dataservice_logo.9a737452.svg +209 -0
- package/dist/static/dataservice_slogo.b9f136dc.svg +209 -0
- package/dist/static/datasharing_logo.6c828c61.svg +28 -0
- package/dist/static/datasharing_slogo.d0ccda7a.svg +28 -0
- package/dist/static/home.c9f8fbce.svg +12 -0
- package/dist/static/ic_gonggongmokuai_m.870acd57.svg +5 -0
- package/dist/static/ic_shujuhuiju_m.aceecaa1.svg +5 -0
- package/dist/static/ic_shujukaifa_m.a1b978b5.svg +15 -0
- package/dist/static/ic_shujukaifang_m.205ec04f.svg +5 -0
- package/dist/static/ic_shujuyingyong_m.4fed335c.svg +5 -0
- package/dist/static/ic_shujuzhili_m.9762b4f0.svg +5 -0
- package/dist/static/menuIcon.a281e69f.svg +1 -0
- package/dist/static/messageCenter.87236800.svg +1 -0
- package/dist/static/metadata_logo.45d05339.svg +25 -0
- package/dist/static/metadata_slogo.64e545f1.svg +25 -0
- package/dist/static/operate_logo.2a7ee3a9.svg +63 -0
- package/dist/static/operate_slogo.b46625a9.svg +63 -0
- package/dist/static/personalCenter.40f40e04.svg +16 -0
- package/dist/static/quality_logo.ef4e102a.svg +26 -0
- package/dist/static/quality_slogo.3557a527.svg +26 -0
- package/dist/static/systemManage.cc20d139.svg +16 -0
- package/dist/static/workorder_slogo.72b76127.svg +54 -0
- package/dist/umi.css +1 -0
- package/dist/umi.js +1 -0
- package/package.json +3 -2
- package/src/.umi/.cache/babel-loader/0cf458567cfdaa4bcc98ad17f126d505.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/172487ddf659c5e5ed4c4cc43ab177d9.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/1d496c36e309d0a102e0dac5294c7868.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/1d61f257af04e239d0ea836688a06494.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/2778829a08334bd378a2fdd98391a43c.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/2a52a607066a02cb72bc9f72140998a3.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/3076ff60b33bd715e63da884712660ff.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/35fcc056042728656dfce9dd67b6bbc6.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/382b0d400111ab0b80c259db1aa480ae.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/38966e8352b47ea30f67e98ce8dfbce1.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/61ed376d37914f796e6ee3e7206c53bd.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/66357c799ae9dc8d0fdcab0abb98e3be.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/713975e5f8979c076b77105bcc664433.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/737e9e5ca4f0aa3883a7d8623a1560f3.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/78278b5a6929a5a79cdf84421140a995.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/80e5871bc78e732263638960b11de875.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/8ce21ab4f5fb95407c2f635f6e0e9713.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/8e6fb4487c51c552ca584b2f53dc3810.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/8e7e40a2e6770c8f279024db25bc8fcf.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/91ab7e7c6e4b220534b7b8dde5825001.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/956e66fcc9441e07247197b2ecf6b440.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/975afa5d1bc90c4c8f37aa402468675d.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/a320cf81322ac1c1440132f0a1713345.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/ae4616202782e31e14cf4b17641b1fe6.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/b501b37dd395c6fe3df5b9f9f2217710.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/c052495a4884502f57654ee834ae0a85.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/c1062507fd6703590141de4c872c47de.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/c14e03befcbd217f8aa57a7a7600590c.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/c84d64ffe481659b495089907db80c2c.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/d55b6d19818be24dbc615a2bf90f5c53.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/de423f345d70a7488000626c81305752.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/ec3a1cda1f0c32a803e9a9140d97110d.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/f5c49dbe2f3c9fbba9c8b04c3254d7bb.json.gz +0 -0
- package/src/.umi/core/history.ts +21 -0
- package/src/.umi/core/plugin.ts +8 -0
- package/src/.umi/core/pluginConfig.d.ts +304 -0
- package/src/.umi/core/pluginRegister.ts +15 -0
- package/src/.umi/core/polyfill.ts +4 -0
- package/src/.umi/core/routes.ts +24 -0
- package/src/.umi/core/umiExports.ts +7 -0
- package/src/.umi/plugin-helmet/exports.ts +3 -0
- package/src/.umi/plugin-initial-state/Provider.tsx +37 -0
- package/src/.umi/plugin-initial-state/exports.ts +7 -0
- package/src/.umi/plugin-initial-state/models/initialState.ts +2 -0
- package/src/.umi/plugin-initial-state/runtime.tsx +13 -0
- package/src/.umi/plugin-model/Provider.tsx +39 -0
- package/src/.umi/plugin-model/helpers/constant.tsx +4 -0
- package/src/.umi/plugin-model/helpers/dispatcher.tsx +19 -0
- package/src/.umi/plugin-model/helpers/executor.tsx +83 -0
- package/src/.umi/plugin-model/runtime.tsx +12 -0
- package/src/.umi/plugin-model/useModel.tsx +71 -0
- package/src/.umi/plugin-request/request.ts +278 -0
- package/src/.umi/umi.ts +58 -0
- package/src/assets/muluguanli_slogo.png +0 -0
- package/src/assets/ziyuanguanli_slogo.png +0 -0
- package/src/pages/ModuleMenu/constData.jsx +15 -5
- package/src/pages/ModuleMenu/index.jsx +42 -65
- package/src/pages/ModuleMenu/index.less +109 -90
- package/src/pages/ModuleUser/index.jsx +103 -25
- package/src/pages/ModuleUser/index.less +46 -34
- package/src/pages/util/axios.js +35 -10
- package/src/pages/util/config.js +4 -8
- package/src/pages/util/permessionUtils.js +1 -19
- package/src/pages/util/userInfo.js +64 -39
package/src/pages/util/axios.js
CHANGED
|
@@ -4,17 +4,30 @@ import baseCof from './config';
|
|
|
4
4
|
import getStore from './userInfo';
|
|
5
5
|
import { checkToken} from './permessionUtils';
|
|
6
6
|
|
|
7
|
-
let tokenValue='
|
|
7
|
+
let tokenValue='7112f7c33eb24011a97d88ceaa285b9e';
|
|
8
|
+
// tokenInSessionStor存在为一体化,不存在为轻量级
|
|
9
|
+
const tokenInSessionStor = window.sessionStorage.getItem('bigdata-access_token');
|
|
10
|
+
const DEFAULT_LOGOUT_URL = tokenInSessionStor? '/#/login':'/admin-ui/login'
|
|
8
11
|
|
|
9
12
|
axios.interceptors.response.use(
|
|
10
13
|
(response) => {
|
|
11
14
|
if (response.status === 200) {
|
|
12
15
|
return response;
|
|
13
16
|
} else if (response.status === 401 || response.status === 302 || response.status === 403) {
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
// 一体化需要调接口判断token是否过期,轻量级直接退出
|
|
18
|
+
if(tokenInSessionStor){
|
|
19
|
+
if (process.env.NODE_ENV === 'production') {
|
|
20
|
+
tokenValue = getStore({ name: 'access_token' });
|
|
21
|
+
}
|
|
22
|
+
checkToken(tokenValue);
|
|
23
|
+
}else{
|
|
24
|
+
message.error({content:'用户凭证已过期,请重新登录', onClose: ()=>{
|
|
25
|
+
localStorage.clear();
|
|
26
|
+
sessionStorage.clear();
|
|
27
|
+
window.location.href = DEFAULT_LOGOUT_URL;
|
|
28
|
+
}});
|
|
16
29
|
}
|
|
17
|
-
|
|
30
|
+
|
|
18
31
|
} else {
|
|
19
32
|
console.log('接口异常 response');
|
|
20
33
|
return Promise.reject('error');
|
|
@@ -24,10 +37,18 @@ axios.interceptors.response.use(
|
|
|
24
37
|
console.log('error', error)
|
|
25
38
|
if (error.response) {
|
|
26
39
|
if (error.response.status === 401) {
|
|
27
|
-
if
|
|
28
|
-
|
|
40
|
+
if(tokenInSessionStor){
|
|
41
|
+
if (process.env.NODE_ENV === 'production') {
|
|
42
|
+
tokenValue = getStore({ name: 'access_token' });
|
|
43
|
+
}
|
|
44
|
+
checkToken(tokenValue);
|
|
45
|
+
}else{
|
|
46
|
+
message.error({content:'用户凭证已过期,请重新登录', onClose: ()=>{
|
|
47
|
+
localStorage.clear();
|
|
48
|
+
sessionStorage.clear();
|
|
49
|
+
window.location.href = DEFAULT_LOGOUT_URL;
|
|
50
|
+
}});
|
|
29
51
|
}
|
|
30
|
-
checkToken(tokenValue);
|
|
31
52
|
} else if (error.response.status === 403) {
|
|
32
53
|
// 提示无权限等
|
|
33
54
|
} else {
|
|
@@ -69,8 +90,6 @@ axios.interceptors.request.use(
|
|
|
69
90
|
);
|
|
70
91
|
|
|
71
92
|
function Axios(method, api, params, map) {
|
|
72
|
-
// console.log(params)
|
|
73
|
-
|
|
74
93
|
let httpDefult;
|
|
75
94
|
// 几个外部特殊接口
|
|
76
95
|
// 退出登录
|
|
@@ -81,7 +100,6 @@ function Axios(method, api, params, map) {
|
|
|
81
100
|
params: params,
|
|
82
101
|
...map,
|
|
83
102
|
};
|
|
84
|
-
console.log('httpDefult', httpDefult)
|
|
85
103
|
} else if (api === '/admin/social/logoutUri') {
|
|
86
104
|
httpDefult = {
|
|
87
105
|
method: method,
|
|
@@ -89,6 +107,13 @@ function Axios(method, api, params, map) {
|
|
|
89
107
|
params: params,
|
|
90
108
|
...map,
|
|
91
109
|
};
|
|
110
|
+
}else if(api.search("/admin-api") !== -1){
|
|
111
|
+
httpDefult = {
|
|
112
|
+
method: method,
|
|
113
|
+
url: `${baseCof.baseSever}${api}`,
|
|
114
|
+
params: params,
|
|
115
|
+
...map,
|
|
116
|
+
};
|
|
92
117
|
}else if(api.search("check_token") !== -1){
|
|
93
118
|
httpDefult = {
|
|
94
119
|
method: method,
|
package/src/pages/util/config.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
basePath: `/app/cmcc/data`,
|
|
6
|
-
}:{
|
|
7
|
-
baseSever: 'http://localhost:8000',
|
|
8
|
-
basePath: '/cmcc/data',
|
|
1
|
+
const {origin} = window.location
|
|
2
|
+
const baseCof = {
|
|
3
|
+
baseSever: origin,
|
|
4
|
+
basePath: process.env.NODE_ENV === 'production'?`/app/cmcc/data`:'/cmcc/data',
|
|
9
5
|
};
|
|
10
6
|
export default baseCof;
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import Axios from './axios';
|
|
2
2
|
import { message } from 'antd';
|
|
3
3
|
|
|
4
|
-
const DEFAULT_LOGOUT_URL = '/#/login'
|
|
5
|
-
// 退出登录
|
|
6
|
-
export const logout = () => {
|
|
7
|
-
Axios('delete','/auth/token/logout', '', {} )
|
|
8
|
-
.then(() => {
|
|
9
|
-
// console.log('退出登录接口调用成功')
|
|
10
|
-
localStorage.clear();
|
|
11
|
-
sessionStorage.clear();
|
|
12
|
-
window.location.href = DEFAULT_LOGOUT_URL;
|
|
13
|
-
})
|
|
14
|
-
.catch((error) => {
|
|
15
|
-
console.error('Error while logging out, error:', error);
|
|
16
|
-
message.error('服务器错误,请稍后重试');
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
4
|
// 校验token是否失效
|
|
20
5
|
export const checkToken = (token) => {
|
|
21
6
|
Axios('get',`/auth/oauth/check_token?token=${token}`, '', {} ).then(
|
|
@@ -24,10 +9,7 @@ export const checkToken = (token) => {
|
|
|
24
9
|
message.error({content:'用户凭证已过期,请重新登录', onClose: ()=>{
|
|
25
10
|
localStorage.clear();
|
|
26
11
|
sessionStorage.clear();
|
|
27
|
-
window.location.href =
|
|
12
|
+
window.location.href = '/#/login';
|
|
28
13
|
}});
|
|
29
|
-
// localStorage.clear();
|
|
30
|
-
// sessionStorage.clear();
|
|
31
|
-
// window.location.href = DEFAULT_LOGOUT_URL;
|
|
32
14
|
})
|
|
33
15
|
}
|
|
@@ -1,50 +1,75 @@
|
|
|
1
|
+
// tokenInSessionStor存在为一体化,不存在为轻量级
|
|
2
|
+
const tokenInSessionStor = window.sessionStorage.getItem('bigdata-access_token');
|
|
1
3
|
/**
|
|
2
4
|
* 获取认证相关的localStorage/SessionStorage
|
|
3
5
|
*/
|
|
4
6
|
function getStore(params) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
7
|
+
if(tokenInSessionStor){
|
|
8
|
+
let { name } = params;
|
|
9
|
+
const { debug } = params;
|
|
10
|
+
const keyName = 'bigdata-';
|
|
11
|
+
name = keyName + name;
|
|
12
|
+
let obj = {};
|
|
13
|
+
let content;
|
|
14
|
+
obj = window.sessionStorage.getItem(name);
|
|
15
|
+
if (!obj || Object.keys(obj).length === 0) obj = window.localStorage.getItem(name);
|
|
16
|
+
if (!obj || Object.keys(obj).length === 0) return '';
|
|
17
|
+
try {
|
|
18
|
+
obj = JSON.parse(obj);
|
|
19
|
+
} catch (e) {
|
|
20
|
+
return '';
|
|
21
|
+
}
|
|
22
|
+
if (debug) {
|
|
23
|
+
return '';
|
|
24
|
+
}
|
|
25
|
+
if (obj.dataType === 'string') {
|
|
26
|
+
content = obj.content;
|
|
27
|
+
} else if (obj.dataType === 'number') {
|
|
28
|
+
content = Number(obj.content);
|
|
29
|
+
} else if (obj.dataType === 'boolean') {
|
|
30
|
+
// eslint-disable-next-line no-eval
|
|
31
|
+
content = eval(obj.content);
|
|
32
|
+
} else if (obj.dataType === 'object') {
|
|
33
|
+
content = obj.content;
|
|
34
|
+
}
|
|
35
|
+
return content;
|
|
36
|
+
}else{
|
|
37
|
+
let { name } = params;
|
|
38
|
+
let storageStr = '';
|
|
39
|
+
if (name === 'access_token') {
|
|
40
|
+
storageStr = localStorage.getItem('ACCESS_TOKEN');
|
|
41
|
+
} else if (name === 'tenantId') {
|
|
42
|
+
// 暂定当前租户 curTenantId
|
|
43
|
+
storageStr = localStorage.getItem('curTenantId');
|
|
44
|
+
} else if (name === 'tenantName') {
|
|
45
|
+
// 暂定当前租户 curTenantId
|
|
46
|
+
storageStr = localStorage.getItem('curTenantName');
|
|
47
|
+
}else if (name === 'userName') {
|
|
48
|
+
// 获取当前登录用户名称
|
|
49
|
+
storageStr = localStorage.getItem('userName');
|
|
50
|
+
} else if (name === 'userId') {
|
|
51
|
+
// 获取当前登录用户Id
|
|
52
|
+
storageStr = localStorage.getItem('userId');
|
|
53
|
+
}
|
|
54
|
+
return storageStr;
|
|
31
55
|
}
|
|
32
|
-
|
|
56
|
+
|
|
33
57
|
}
|
|
34
58
|
export default getStore;
|
|
35
59
|
|
|
36
60
|
export const getUserName = () => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
61
|
+
if(tokenInSessionStor){
|
|
62
|
+
const userInfo = getStore({ name: 'userInfo' });
|
|
63
|
+
if (userInfo && Object.keys(userInfo).length > 0 && userInfo.username) {
|
|
64
|
+
return userInfo.username;
|
|
65
|
+
}
|
|
66
|
+
return '';
|
|
67
|
+
}else{
|
|
68
|
+
const name = getStore({ name: 'userName' });
|
|
69
|
+
if (!name) {
|
|
70
|
+
return '';
|
|
40
71
|
}
|
|
41
|
-
return
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const getUserId = () => {
|
|
45
|
-
const userInfo = getStore({ name: 'userInfo' });
|
|
46
|
-
if (userInfo && Object.keys(userInfo).length > 0 && userInfo.id) {
|
|
47
|
-
return userInfo.id;
|
|
72
|
+
return name;
|
|
48
73
|
}
|
|
49
|
-
|
|
50
|
-
};
|
|
74
|
+
|
|
75
|
+
};
|