agilebuilder-ui 1.0.67 → 1.0.68
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/package.json +1 -1
- package/src/utils/auth.js +6 -0
- package/src/utils/request.js +3 -5
package/package.json
CHANGED
package/src/utils/auth.js
CHANGED
|
@@ -143,6 +143,12 @@ export function removeProjectCode() {
|
|
|
143
143
|
authApi.removeCookieCache('_PROJECT_CDOE')
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
export function getRunCurrentRole() {
|
|
147
|
+
let runCurrentRoleKey = '_RUN_CURRENT_ROLE'
|
|
148
|
+
if(!isDevpSystem()){
|
|
149
|
+
return authApi.getSessionCache(runCurrentRoleKey)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
146
152
|
// 清空token时需要清除的缓存信息
|
|
147
153
|
export function clearPermission() {
|
|
148
154
|
removeToken()
|
package/src/utils/request.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import axios from 'axios'
|
|
2
2
|
import { ElMessage as Message } from 'element-plus'
|
|
3
|
-
import { getToken, removeToken } from './auth'
|
|
3
|
+
import { getToken, removeToken, getRunCurrentRole } from './auth'
|
|
4
4
|
import store from '../store'
|
|
5
5
|
import checkPermission from './permission'
|
|
6
|
-
import * as Vue from 'vue'
|
|
7
6
|
import { getI18n } from './util'
|
|
8
|
-
import authApi from './auth-api'
|
|
9
7
|
import {
|
|
10
8
|
getRelativeBaseUrl,
|
|
11
9
|
getTimeZone,
|
|
@@ -29,10 +27,10 @@ service.interceptors.request.use(
|
|
|
29
27
|
if (token) {
|
|
30
28
|
config.headers['Authorization'] = token // 让每个请求携带自定义token 请根据实际情况自行修改
|
|
31
29
|
}
|
|
32
|
-
|
|
33
|
-
const currentRole = authApi.getSessionCache(runCurrentRoleKey)
|
|
30
|
+
const currentRole = getRunCurrentRole()
|
|
34
31
|
// console.log('axios请求后台11---currentRole=', currentRole)
|
|
35
32
|
if(currentRole){
|
|
33
|
+
let runCurrentRoleKey = '_RUN_CURRENT_ROLE'
|
|
36
34
|
config.headers[runCurrentRoleKey] = currentRole
|
|
37
35
|
}
|
|
38
36
|
// console.log('axios请求后台22---config=', config)
|