module-menu-vue 0.1.0 → 0.1.3
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/index.js +4 -4
- package/package.json +1 -1
- package/src/assets/personalCenter.svg +15 -15
- package/src/assets/systemManage.svg +15 -15
- package/src/components/Menu/ModuleMenu.vue +312 -309
- package/src/components/Menu/constant.js +504 -504
- package/src/components/Menu/menu.css +106 -106
- package/src/components/Menu/service.js +25 -25
- package/src/components/Portal/PortalBtn.vue +30 -30
- package/src/components/Tenant/TenantList.vue +70 -70
- package/src/components/Tenant/service.js +17 -17
- package/src/components/User/UserInfo.vue +213 -213
- package/src/components/User/constant.js +11 -11
- package/src/components/User/service.js +14 -14
- package/src/components/Util/axios.js +89 -89
- package/src/components/Util/config.js +13 -13
- package/src/components/Util/permessionUtils.js +25 -25
- package/src/components/Util/userInfo.js +96 -96
- package/vue.config.js +34 -34
|
@@ -1,214 +1,214 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div className="right">
|
|
3
|
-
<el-dropdown v-show="getName()" @command="handleClickmenu">
|
|
4
|
-
<span class="el-dropdown-link">
|
|
5
|
-
<img src="../../assets/userLogo.svg" style="vertical-align:middle;padding-right:10px"/>
|
|
6
|
-
<span :style="{color: stash === 'LNRD' ? '#fff' : '#000000d9'}">{{getName()}}</span>
|
|
7
|
-
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
8
|
-
</span>
|
|
9
|
-
<el-dropdown-menu slot="dropdown">
|
|
10
|
-
<el-dropdown-item command="single">
|
|
11
|
-
<img :src="PersonalCenterSrc" alt="" class="menuItem" />
|
|
12
|
-
<span>{{["integration", 'LNRD'].includes(stash) ? '用户中心' : '个人中心'}}</span>
|
|
13
|
-
</el-dropdown-item>
|
|
14
|
-
<el-dropdown-item v-show="isShowSys" command="systerm">
|
|
15
|
-
<img :src="SystemManageSrc" alt="" class="menuItem" />
|
|
16
|
-
<span>系统管理</span>
|
|
17
|
-
</el-dropdown-item>
|
|
18
|
-
<el-dropdown-item v-show="isShowApp" command="app">
|
|
19
|
-
<img :src="appSystemSrc" alt="" class="menuItem" />
|
|
20
|
-
<span>应用系统配置</span>
|
|
21
|
-
</el-dropdown-item>
|
|
22
|
-
<el-dropdown-item command="logout">
|
|
23
|
-
<img :src="LogoutSrc" alt="" class="menuItem" />
|
|
24
|
-
<span>退出登录</span>
|
|
25
|
-
</el-dropdown-item>
|
|
26
|
-
</el-dropdown-menu>
|
|
27
|
-
</el-dropdown>
|
|
28
|
-
</div>
|
|
29
|
-
</template>
|
|
30
|
-
<script>
|
|
31
|
-
import Axios from '../Util/axios.js'
|
|
32
|
-
import { userMenuIcon } from './constant.js'
|
|
33
|
-
import { getUserName, getIsHaveSystemManagementPermissionFlag } from './../Util/userInfo.js'
|
|
34
|
-
import { integrationLogout, getSysUrl } from './service.js'
|
|
35
|
-
import {getMenuList} from '../Menu/service.js'
|
|
36
|
-
export default {
|
|
37
|
-
name: 'UserInfo',
|
|
38
|
-
data () {
|
|
39
|
-
return {
|
|
40
|
-
isHaveSystemManagementPermission: getIsHaveSystemManagementPermissionFlag(),
|
|
41
|
-
PersonalCenterSrc: userMenuIcon.PersonalCenterSrc,
|
|
42
|
-
MessageCenterSrc: userMenuIcon.MessageCenterSrc,
|
|
43
|
-
SystemManageSrc: userMenuIcon.SystemManageSrc,
|
|
44
|
-
appSystemSrc: userMenuIcon.appSystemSrc,
|
|
45
|
-
LogoutSrc: userMenuIcon.LogoutSrc,
|
|
46
|
-
isShowApp: false
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
computed: {
|
|
50
|
-
// 是否显示系统管理菜单项
|
|
51
|
-
isShowSys () {
|
|
52
|
-
return ["integration", 'LNRD'].includes(this.stash) ? true : this.sysName !== 'admin' && this.isHaveSystemManagementPermission
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
props: {
|
|
56
|
-
sysName: {
|
|
57
|
-
type: String,
|
|
58
|
-
default: 'admin'
|
|
59
|
-
},
|
|
60
|
-
stash: {
|
|
61
|
-
type: String,
|
|
62
|
-
default: ''
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
created() {
|
|
66
|
-
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
67
|
-
this.isShowAppFunc()
|
|
68
|
-
}
|
|
69
|
-
if (this.stash === 'GZW') {
|
|
70
|
-
sessionStorage.setItem('stash', 'GZW')
|
|
71
|
-
} else if (this.stash === 'PANWEI') {
|
|
72
|
-
sessionStorage.setItem('stash', 'PANWEI')
|
|
73
|
-
} else {
|
|
74
|
-
sessionStorage.removeItem('stash')
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
methods: {
|
|
78
|
-
async isShowAppFunc() {
|
|
79
|
-
const rsp = await getMenuList()
|
|
80
|
-
const rspData = rsp.data.data
|
|
81
|
-
if (rspData && rspData.length > 0) {
|
|
82
|
-
const routesList = rspData[0].routes
|
|
83
|
-
if (routesList) {
|
|
84
|
-
routesList.forEach(item => {
|
|
85
|
-
if (item.path.indexOf('appSystem') !== -1) {
|
|
86
|
-
this.isShowApp = true
|
|
87
|
-
}
|
|
88
|
-
})
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
handleClickmenu (flag){
|
|
93
|
-
let url = ''
|
|
94
|
-
if (flag === 'single') {
|
|
95
|
-
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
96
|
-
url = '/admin-ui/data-share-portal/personal/info'
|
|
97
|
-
} else if (this.stash === "GZW") {
|
|
98
|
-
url = '/data-platform/#/info/index'
|
|
99
|
-
} else if (this.stash === "PANWEI") {
|
|
100
|
-
url = '/bigdata-portal/#/info/index'
|
|
101
|
-
} else {
|
|
102
|
-
url = '/#/info/index'
|
|
103
|
-
}
|
|
104
|
-
location.href = url;
|
|
105
|
-
} else if (flag === 'systerm') {
|
|
106
|
-
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
107
|
-
// 查询 系统管理 需要跳转的页面
|
|
108
|
-
getSysUrl().then(rsp => {
|
|
109
|
-
const data = rsp.data.data
|
|
110
|
-
if (data) {
|
|
111
|
-
location.href = '/admin-ui' + data.path
|
|
112
|
-
}
|
|
113
|
-
}).catch(e => {
|
|
114
|
-
console.error('getSysUrl 接口异常: ', e)
|
|
115
|
-
})
|
|
116
|
-
} else {
|
|
117
|
-
const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
|
|
118
|
-
let systemPath = ''
|
|
119
|
-
if (menuObj) {
|
|
120
|
-
menuObj.content.forEach(obj => {
|
|
121
|
-
if (obj.name === '权限管理' && obj.children.length > 0) {
|
|
122
|
-
systemPath = obj.children[0].path
|
|
123
|
-
}
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
if (this.sysName === 'admin') {
|
|
127
|
-
let url = ''
|
|
128
|
-
if (this.stash === "GZW") {
|
|
129
|
-
url = `/data-platform/#${systemPath}`
|
|
130
|
-
} else if (this.stash === 'PANWEI') {
|
|
131
|
-
url = `/bigdata-portal/#${systemPath}`
|
|
132
|
-
} else {
|
|
133
|
-
url = `/#${systemPath}`
|
|
134
|
-
}
|
|
135
|
-
location.href = url
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
} else if (flag === 'app') {
|
|
139
|
-
url = '/dataadmin/#/appSystem/index'
|
|
140
|
-
location.href = url;
|
|
141
|
-
} else if (flag === 'logout') {
|
|
142
|
-
this.logoutFunc()
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
async logoutFunc () {
|
|
146
|
-
console.log('开始调用退出接口...')
|
|
147
|
-
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
148
|
-
await integrationLogout();
|
|
149
|
-
this.logoutUrl()
|
|
150
|
-
} else {
|
|
151
|
-
let url = ''
|
|
152
|
-
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
153
|
-
url = '/admin-ui/system/auth/logout'
|
|
154
|
-
} else if (this.stash === 'GZW') {
|
|
155
|
-
url = '/data-platform/auth/token/logout'
|
|
156
|
-
} else {
|
|
157
|
-
url = '/auth/token/logout'
|
|
158
|
-
}
|
|
159
|
-
const method = ["integration", 'LNRD'].includes(this.stash) ? 'post' : 'delete'
|
|
160
|
-
Axios(url, method).then(() => {
|
|
161
|
-
this.logoutUrl();
|
|
162
|
-
})
|
|
163
|
-
.catch((err) => {
|
|
164
|
-
console.log('err: ', err)
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
},
|
|
168
|
-
logoutUrl() {
|
|
169
|
-
localStorage.clear();
|
|
170
|
-
sessionStorage.clear();
|
|
171
|
-
let url = ''
|
|
172
|
-
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
173
|
-
url = '/admin-ui/login'
|
|
174
|
-
} else if (this.stash === 'GZW') {
|
|
175
|
-
url = '/data-platform/#/login'
|
|
176
|
-
} else if (this.stash === 'PANWEI') {
|
|
177
|
-
url = '/bigdata-portal/#/login'
|
|
178
|
-
} else {
|
|
179
|
-
url = '/#/login'
|
|
180
|
-
}
|
|
181
|
-
location.href = url
|
|
182
|
-
},
|
|
183
|
-
getName () {
|
|
184
|
-
return getUserName()
|
|
185
|
-
},
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
</script>
|
|
189
|
-
|
|
190
|
-
<style scoped>
|
|
191
|
-
.menuItem {
|
|
192
|
-
margin-right: 10px;
|
|
193
|
-
margin-top: 10px;
|
|
194
|
-
vertical-align: sub;
|
|
195
|
-
}
|
|
196
|
-
.el-dropdown-menu{
|
|
197
|
-
width: 145px;
|
|
198
|
-
height: auto;
|
|
199
|
-
padding: 3px 0;
|
|
200
|
-
}
|
|
201
|
-
.el-dropdown-menu__item, .el-menu-item {
|
|
202
|
-
font-size: 13px;
|
|
203
|
-
}
|
|
204
|
-
.el-dropdown-menu__item img {
|
|
205
|
-
width: 13px;
|
|
206
|
-
}
|
|
207
|
-
.el-dropdown-link{
|
|
208
|
-
font-weight: 600;
|
|
209
|
-
color: rgba(0, 0, 0, 0.85);
|
|
210
|
-
}
|
|
211
|
-
.el-popper{
|
|
212
|
-
margin-top: -2px !important;
|
|
213
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div className="right">
|
|
3
|
+
<el-dropdown v-show="getName()" @command="handleClickmenu">
|
|
4
|
+
<span class="el-dropdown-link">
|
|
5
|
+
<img src="../../assets/userLogo.svg" style="vertical-align:middle;padding-right:10px"/>
|
|
6
|
+
<span :style="{color: stash === 'LNRD' ? '#fff' : '#000000d9'}">{{getName()}}</span>
|
|
7
|
+
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
8
|
+
</span>
|
|
9
|
+
<el-dropdown-menu slot="dropdown">
|
|
10
|
+
<el-dropdown-item command="single">
|
|
11
|
+
<img :src="PersonalCenterSrc" alt="" class="menuItem" />
|
|
12
|
+
<span>{{["integration", 'LNRD'].includes(stash) ? '用户中心' : '个人中心'}}</span>
|
|
13
|
+
</el-dropdown-item>
|
|
14
|
+
<el-dropdown-item v-show="isShowSys" command="systerm">
|
|
15
|
+
<img :src="SystemManageSrc" alt="" class="menuItem" />
|
|
16
|
+
<span>系统管理</span>
|
|
17
|
+
</el-dropdown-item>
|
|
18
|
+
<el-dropdown-item v-show="isShowApp" command="app">
|
|
19
|
+
<img :src="appSystemSrc" alt="" class="menuItem" />
|
|
20
|
+
<span>应用系统配置</span>
|
|
21
|
+
</el-dropdown-item>
|
|
22
|
+
<el-dropdown-item command="logout">
|
|
23
|
+
<img :src="LogoutSrc" alt="" class="menuItem" />
|
|
24
|
+
<span>退出登录</span>
|
|
25
|
+
</el-dropdown-item>
|
|
26
|
+
</el-dropdown-menu>
|
|
27
|
+
</el-dropdown>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
<script>
|
|
31
|
+
import Axios from '../Util/axios.js'
|
|
32
|
+
import { userMenuIcon } from './constant.js'
|
|
33
|
+
import { getUserName, getIsHaveSystemManagementPermissionFlag } from './../Util/userInfo.js'
|
|
34
|
+
import { integrationLogout, getSysUrl } from './service.js'
|
|
35
|
+
import {getMenuList} from '../Menu/service.js'
|
|
36
|
+
export default {
|
|
37
|
+
name: 'UserInfo',
|
|
38
|
+
data () {
|
|
39
|
+
return {
|
|
40
|
+
isHaveSystemManagementPermission: getIsHaveSystemManagementPermissionFlag(),
|
|
41
|
+
PersonalCenterSrc: userMenuIcon.PersonalCenterSrc,
|
|
42
|
+
MessageCenterSrc: userMenuIcon.MessageCenterSrc,
|
|
43
|
+
SystemManageSrc: userMenuIcon.SystemManageSrc,
|
|
44
|
+
appSystemSrc: userMenuIcon.appSystemSrc,
|
|
45
|
+
LogoutSrc: userMenuIcon.LogoutSrc,
|
|
46
|
+
isShowApp: false
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
computed: {
|
|
50
|
+
// 是否显示系统管理菜单项
|
|
51
|
+
isShowSys () {
|
|
52
|
+
return ["integration", 'LNRD'].includes(this.stash) ? true : this.sysName !== 'admin' && this.isHaveSystemManagementPermission
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
props: {
|
|
56
|
+
sysName: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: 'admin'
|
|
59
|
+
},
|
|
60
|
+
stash: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: ''
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
created() {
|
|
66
|
+
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
67
|
+
this.isShowAppFunc()
|
|
68
|
+
}
|
|
69
|
+
if (this.stash === 'GZW') {
|
|
70
|
+
sessionStorage.setItem('stash', 'GZW')
|
|
71
|
+
} else if (this.stash === 'PANWEI') {
|
|
72
|
+
sessionStorage.setItem('stash', 'PANWEI')
|
|
73
|
+
} else {
|
|
74
|
+
sessionStorage.removeItem('stash')
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
methods: {
|
|
78
|
+
async isShowAppFunc() {
|
|
79
|
+
const rsp = await getMenuList()
|
|
80
|
+
const rspData = rsp.data.data
|
|
81
|
+
if (rspData && rspData.length > 0) {
|
|
82
|
+
const routesList = rspData[0].routes
|
|
83
|
+
if (routesList) {
|
|
84
|
+
routesList.forEach(item => {
|
|
85
|
+
if (item.path.indexOf('appSystem') !== -1) {
|
|
86
|
+
this.isShowApp = true
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
handleClickmenu (flag){
|
|
93
|
+
let url = ''
|
|
94
|
+
if (flag === 'single') {
|
|
95
|
+
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
96
|
+
url = '/admin-ui/data-share-portal/personal/info'
|
|
97
|
+
} else if (this.stash === "GZW") {
|
|
98
|
+
url = '/data-platform/#/info/index'
|
|
99
|
+
} else if (this.stash === "PANWEI") {
|
|
100
|
+
url = '/bigdata-portal/#/info/index'
|
|
101
|
+
} else {
|
|
102
|
+
url = '/#/info/index'
|
|
103
|
+
}
|
|
104
|
+
location.href = url;
|
|
105
|
+
} else if (flag === 'systerm') {
|
|
106
|
+
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
107
|
+
// 查询 系统管理 需要跳转的页面
|
|
108
|
+
getSysUrl().then(rsp => {
|
|
109
|
+
const data = rsp.data.data
|
|
110
|
+
if (data) {
|
|
111
|
+
location.href = '/admin-ui' + data.path
|
|
112
|
+
}
|
|
113
|
+
}).catch(e => {
|
|
114
|
+
console.error('getSysUrl 接口异常: ', e)
|
|
115
|
+
})
|
|
116
|
+
} else {
|
|
117
|
+
const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
|
|
118
|
+
let systemPath = ''
|
|
119
|
+
if (menuObj) {
|
|
120
|
+
menuObj.content.forEach(obj => {
|
|
121
|
+
if (obj.name === '权限管理' && obj.children.length > 0) {
|
|
122
|
+
systemPath = obj.children[0].path
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
if (this.sysName === 'admin') {
|
|
127
|
+
let url = ''
|
|
128
|
+
if (this.stash === "GZW") {
|
|
129
|
+
url = `/data-platform/#${systemPath}`
|
|
130
|
+
} else if (this.stash === 'PANWEI') {
|
|
131
|
+
url = `/bigdata-portal/#${systemPath}`
|
|
132
|
+
} else {
|
|
133
|
+
url = `/#${systemPath}`
|
|
134
|
+
}
|
|
135
|
+
location.href = url
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
} else if (flag === 'app') {
|
|
139
|
+
url = '/dataadmin/#/appSystem/index'
|
|
140
|
+
location.href = url;
|
|
141
|
+
} else if (flag === 'logout') {
|
|
142
|
+
this.logoutFunc()
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
async logoutFunc () {
|
|
146
|
+
console.log('开始调用退出接口...')
|
|
147
|
+
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
148
|
+
await integrationLogout();
|
|
149
|
+
this.logoutUrl()
|
|
150
|
+
} else {
|
|
151
|
+
let url = ''
|
|
152
|
+
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
153
|
+
url = '/admin-ui/system/auth/logout'
|
|
154
|
+
} else if (this.stash === 'GZW') {
|
|
155
|
+
url = '/data-platform/auth/token/logout'
|
|
156
|
+
} else {
|
|
157
|
+
url = '/auth/token/logout'
|
|
158
|
+
}
|
|
159
|
+
const method = ["integration", 'LNRD'].includes(this.stash) ? 'post' : 'delete'
|
|
160
|
+
Axios(url, method).then(() => {
|
|
161
|
+
this.logoutUrl();
|
|
162
|
+
})
|
|
163
|
+
.catch((err) => {
|
|
164
|
+
console.log('err: ', err)
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
logoutUrl() {
|
|
169
|
+
localStorage.clear();
|
|
170
|
+
sessionStorage.clear();
|
|
171
|
+
let url = ''
|
|
172
|
+
if (["integration", 'LNRD'].includes(this.stash)) {
|
|
173
|
+
url = '/admin-ui/login'
|
|
174
|
+
} else if (this.stash === 'GZW') {
|
|
175
|
+
url = '/data-platform/#/login'
|
|
176
|
+
} else if (this.stash === 'PANWEI') {
|
|
177
|
+
url = '/bigdata-portal/#/login'
|
|
178
|
+
} else {
|
|
179
|
+
url = '/#/login'
|
|
180
|
+
}
|
|
181
|
+
location.href = url
|
|
182
|
+
},
|
|
183
|
+
getName () {
|
|
184
|
+
return getUserName()
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
</script>
|
|
189
|
+
|
|
190
|
+
<style scoped>
|
|
191
|
+
.menuItem {
|
|
192
|
+
margin-right: 10px;
|
|
193
|
+
margin-top: 10px;
|
|
194
|
+
vertical-align: sub;
|
|
195
|
+
}
|
|
196
|
+
.el-dropdown-menu{
|
|
197
|
+
width: 145px;
|
|
198
|
+
height: auto;
|
|
199
|
+
padding: 3px 0;
|
|
200
|
+
}
|
|
201
|
+
.el-dropdown-menu__item, .el-menu-item {
|
|
202
|
+
font-size: 13px;
|
|
203
|
+
}
|
|
204
|
+
.el-dropdown-menu__item img {
|
|
205
|
+
width: 13px;
|
|
206
|
+
}
|
|
207
|
+
.el-dropdown-link{
|
|
208
|
+
font-weight: 600;
|
|
209
|
+
color: rgba(0, 0, 0, 0.85);
|
|
210
|
+
}
|
|
211
|
+
.el-popper{
|
|
212
|
+
margin-top: -2px !important;
|
|
213
|
+
}
|
|
214
214
|
</style>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// 图标位置
|
|
2
|
-
export const userMenuIcon = {
|
|
3
|
-
PersonalCenterSrc:require('../../assets/personalCenter.svg'),
|
|
4
|
-
MessageCenterSrc:require('../../assets/messageCenter.svg'),
|
|
5
|
-
SystemManageSrc:require('../../assets/systemManage.svg'),
|
|
6
|
-
appSystemSrc:require('../../assets/appSystem.svg'),
|
|
7
|
-
LogoutSrc:require('../../assets/logout.png'),
|
|
8
|
-
}
|
|
9
|
-
export const PersonalCenterSrc = require('../../assets/personalCenter.svg');
|
|
10
|
-
export const MessageCenterSrc = require('../../assets/messageCenter.svg');
|
|
11
|
-
export const SystemManageSrc = require('../../assets/systemManage.svg');
|
|
1
|
+
// 图标位置
|
|
2
|
+
export const userMenuIcon = {
|
|
3
|
+
PersonalCenterSrc:require('../../assets/personalCenter.svg'),
|
|
4
|
+
MessageCenterSrc:require('../../assets/messageCenter.svg'),
|
|
5
|
+
SystemManageSrc:require('../../assets/systemManage.svg'),
|
|
6
|
+
appSystemSrc:require('../../assets/appSystem.svg'),
|
|
7
|
+
LogoutSrc:require('../../assets/logout.png'),
|
|
8
|
+
}
|
|
9
|
+
export const PersonalCenterSrc = require('../../assets/personalCenter.svg');
|
|
10
|
+
export const MessageCenterSrc = require('../../assets/messageCenter.svg');
|
|
11
|
+
export const SystemManageSrc = require('../../assets/systemManage.svg');
|
|
12
12
|
export const LogoutSrc = require('../../assets/logout.png');
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import request from 'axios'
|
|
2
|
-
// 一体化退出登录
|
|
3
|
-
export const integrationLogout = () => {
|
|
4
|
-
return request('/admin-api/system/auth/logout', {
|
|
5
|
-
method: 'post'
|
|
6
|
-
})
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
// 获取到要跳转的系统管理路径
|
|
10
|
-
export const getSysUrl = () => {
|
|
11
|
-
return request('/admin-api/system/auth/homePage', {
|
|
12
|
-
method: 'get'
|
|
13
|
-
})
|
|
14
|
-
}
|
|
1
|
+
import request from 'axios'
|
|
2
|
+
// 一体化退出登录
|
|
3
|
+
export const integrationLogout = () => {
|
|
4
|
+
return request('/admin-api/system/auth/logout', {
|
|
5
|
+
method: 'post'
|
|
6
|
+
})
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// 获取到要跳转的系统管理路径
|
|
10
|
+
export const getSysUrl = () => {
|
|
11
|
+
return request('/admin-api/system/auth/homePage', {
|
|
12
|
+
method: 'get'
|
|
13
|
+
})
|
|
14
|
+
}
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import getStore from './userInfo';
|
|
3
|
-
import { checkToken } from './permessionUtils';
|
|
4
|
-
let tokenValue = 'ba8db130f3334ae5b432b1398e0c1b1d';
|
|
5
|
-
axios.interceptors.response.use(
|
|
6
|
-
(response) => {
|
|
7
|
-
if (response.status === 200) {
|
|
8
|
-
return response;
|
|
9
|
-
} else if (response.data.code === 401 || response.status === 401 || response.status === 302 || response.status === 403) {
|
|
10
|
-
console.log('response env: ', process.env.NODE_ENV)
|
|
11
|
-
if (process.env.NODE_ENV === 'production') {
|
|
12
|
-
tokenValue = getStore({ name: 'access_token' });
|
|
13
|
-
}
|
|
14
|
-
checkToken(tokenValue);
|
|
15
|
-
} else {
|
|
16
|
-
console.log('接口异常 response');
|
|
17
|
-
return Promise.reject('error');
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
(error) => {
|
|
21
|
-
console.log('error', error)
|
|
22
|
-
if (error.response) {
|
|
23
|
-
if (error.response.status === 401) {
|
|
24
|
-
console.log('response error env: ', process.env.NODE_ENV)
|
|
25
|
-
if (process.env.NODE_ENV === 'production') {
|
|
26
|
-
tokenValue = getStore({ name: 'access_token' });
|
|
27
|
-
}
|
|
28
|
-
checkToken(tokenValue);
|
|
29
|
-
} else if (error.response.status === 403) {
|
|
30
|
-
// 提示无权限等
|
|
31
|
-
} else {
|
|
32
|
-
// 其他错误处理
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
console.log('=========', JSON.stringify(error))
|
|
36
|
-
return Promise.reject(error.response);
|
|
37
|
-
},
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
/** 全局请求拦截器 */
|
|
41
|
-
axios.interceptors.request.use(
|
|
42
|
-
async (params) => {
|
|
43
|
-
// 多种环境,对接门户时,需要在请求头中设置token等信息
|
|
44
|
-
const environmentList = ['production', 'development', 'test']
|
|
45
|
-
console.log('request env: ', process.env.NODE_ENV)
|
|
46
|
-
if (environmentList.includes(process.env.NODE_ENV)) {
|
|
47
|
-
console.log('环境进来了。。。')
|
|
48
|
-
const TENANT_ID = getStore({ name: 'tenantId' }) || '1';
|
|
49
|
-
const isToken = (params.headers || {}).isToken === false;
|
|
50
|
-
const token = getStore({ name: 'access_token' });
|
|
51
|
-
console.log('token', token)
|
|
52
|
-
console.log('isToken', isToken)
|
|
53
|
-
console.log('TENANT_ID', TENANT_ID)
|
|
54
|
-
if (token && !isToken) {
|
|
55
|
-
params.headers['Authorization'] = `Bearer ${token}`;
|
|
56
|
-
}
|
|
57
|
-
if (TENANT_ID) {
|
|
58
|
-
params.headers["TENANT-ID"] = TENANT_ID; // 租户ID
|
|
59
|
-
}
|
|
60
|
-
return params;
|
|
61
|
-
}
|
|
62
|
-
params.headers['Authorization'] = `Bearer ${tokenValue}`;
|
|
63
|
-
params.headers['TENANT-ID'] = '1';
|
|
64
|
-
console.log('params', JSON.stringify(params))
|
|
65
|
-
return params;
|
|
66
|
-
},
|
|
67
|
-
function (error) {
|
|
68
|
-
// 对请求错误做些什么
|
|
69
|
-
return Promise.reject(error);
|
|
70
|
-
},
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
function Axios(url, method) {
|
|
74
|
-
return new Promise((resolve, reject) => {
|
|
75
|
-
axios({
|
|
76
|
-
method: method,
|
|
77
|
-
url: url,
|
|
78
|
-
})
|
|
79
|
-
.then((res) => {
|
|
80
|
-
console.log('res', res)
|
|
81
|
-
resolve(res);
|
|
82
|
-
})
|
|
83
|
-
.catch((err) => {
|
|
84
|
-
console.log('err', err)
|
|
85
|
-
reject(err);
|
|
86
|
-
});
|
|
87
|
-
})
|
|
88
|
-
}
|
|
89
|
-
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import getStore from './userInfo';
|
|
3
|
+
import { checkToken } from './permessionUtils';
|
|
4
|
+
let tokenValue = 'ba8db130f3334ae5b432b1398e0c1b1d';
|
|
5
|
+
axios.interceptors.response.use(
|
|
6
|
+
(response) => {
|
|
7
|
+
if (response.status === 200) {
|
|
8
|
+
return response;
|
|
9
|
+
} else if (response.data.code === 401 || response.status === 401 || response.status === 302 || response.status === 403) {
|
|
10
|
+
console.log('response env: ', process.env.NODE_ENV)
|
|
11
|
+
if (process.env.NODE_ENV === 'production') {
|
|
12
|
+
tokenValue = getStore({ name: 'access_token' });
|
|
13
|
+
}
|
|
14
|
+
checkToken(tokenValue);
|
|
15
|
+
} else {
|
|
16
|
+
console.log('接口异常 response');
|
|
17
|
+
return Promise.reject('error');
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
(error) => {
|
|
21
|
+
console.log('error', error)
|
|
22
|
+
if (error.response) {
|
|
23
|
+
if (error.response.status === 401) {
|
|
24
|
+
console.log('response error env: ', process.env.NODE_ENV)
|
|
25
|
+
if (process.env.NODE_ENV === 'production') {
|
|
26
|
+
tokenValue = getStore({ name: 'access_token' });
|
|
27
|
+
}
|
|
28
|
+
checkToken(tokenValue);
|
|
29
|
+
} else if (error.response.status === 403) {
|
|
30
|
+
// 提示无权限等
|
|
31
|
+
} else {
|
|
32
|
+
// 其他错误处理
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
console.log('=========', JSON.stringify(error))
|
|
36
|
+
return Promise.reject(error.response);
|
|
37
|
+
},
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
/** 全局请求拦截器 */
|
|
41
|
+
axios.interceptors.request.use(
|
|
42
|
+
async (params) => {
|
|
43
|
+
// 多种环境,对接门户时,需要在请求头中设置token等信息
|
|
44
|
+
const environmentList = ['production', 'development', 'test']
|
|
45
|
+
console.log('request env: ', process.env.NODE_ENV)
|
|
46
|
+
if (environmentList.includes(process.env.NODE_ENV)) {
|
|
47
|
+
console.log('环境进来了。。。')
|
|
48
|
+
const TENANT_ID = getStore({ name: 'tenantId' }) || '1';
|
|
49
|
+
const isToken = (params.headers || {}).isToken === false;
|
|
50
|
+
const token = getStore({ name: 'access_token' });
|
|
51
|
+
console.log('token', token)
|
|
52
|
+
console.log('isToken', isToken)
|
|
53
|
+
console.log('TENANT_ID', TENANT_ID)
|
|
54
|
+
if (token && !isToken) {
|
|
55
|
+
params.headers['Authorization'] = `Bearer ${token}`;
|
|
56
|
+
}
|
|
57
|
+
if (TENANT_ID) {
|
|
58
|
+
params.headers["TENANT-ID"] = TENANT_ID; // 租户ID
|
|
59
|
+
}
|
|
60
|
+
return params;
|
|
61
|
+
}
|
|
62
|
+
params.headers['Authorization'] = `Bearer ${tokenValue}`;
|
|
63
|
+
params.headers['TENANT-ID'] = '1';
|
|
64
|
+
console.log('params', JSON.stringify(params))
|
|
65
|
+
return params;
|
|
66
|
+
},
|
|
67
|
+
function (error) {
|
|
68
|
+
// 对请求错误做些什么
|
|
69
|
+
return Promise.reject(error);
|
|
70
|
+
},
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
function Axios(url, method) {
|
|
74
|
+
return new Promise((resolve, reject) => {
|
|
75
|
+
axios({
|
|
76
|
+
method: method,
|
|
77
|
+
url: url,
|
|
78
|
+
})
|
|
79
|
+
.then((res) => {
|
|
80
|
+
console.log('res', res)
|
|
81
|
+
resolve(res);
|
|
82
|
+
})
|
|
83
|
+
.catch((err) => {
|
|
84
|
+
console.log('err', err)
|
|
85
|
+
reject(err);
|
|
86
|
+
});
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
|
|
90
90
|
export default Axios;
|