module-menu-vue 0.0.48 → 0.0.49
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
CHANGED
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
</template>
|
|
26
26
|
<script>
|
|
27
|
-
import Axios from '../Util/axios.js'
|
|
27
|
+
// import Axios from '../Util/axios.js'
|
|
28
28
|
import { userMenuIcon } from './constant.js'
|
|
29
29
|
import { getUserName } from './../Util/userInfo.js'
|
|
30
|
+
import { integrationLogout, compactLogout } from './service.js'
|
|
30
31
|
export default {
|
|
31
32
|
name: 'UserInfo',
|
|
32
33
|
data () {
|
|
@@ -66,18 +67,29 @@ export default {
|
|
|
66
67
|
}
|
|
67
68
|
location.href = url;
|
|
68
69
|
},
|
|
69
|
-
logoutFunc () {
|
|
70
|
+
async logoutFunc () {
|
|
70
71
|
console.log('开始调用退出接口...')
|
|
71
|
-
const url = this.stash === 'integration' ? '/admin-api/system/auth/logout' : '/auth/token/logout'
|
|
72
|
-
const method = this.stash === 'integration'? 'post' : 'delete'
|
|
73
|
-
Axios(url, method).then(() => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
})
|
|
78
|
-
.catch((err) => {
|
|
79
|
-
|
|
80
|
-
});
|
|
72
|
+
// const url = this.stash === 'integration' ? '/admin-api/system/auth/logout' : '/auth/token/logout'
|
|
73
|
+
// const method = this.stash === 'integration'? 'post' : 'delete'
|
|
74
|
+
// Axios(url, method).then(() => {
|
|
75
|
+
// localStorage.clear();
|
|
76
|
+
// sessionStorage.clear();
|
|
77
|
+
// location.href = this.stash === "integration" ? '/admin-ui/login' : '/#/login'
|
|
78
|
+
// })
|
|
79
|
+
// .catch((err) => {
|
|
80
|
+
// console.log('err: ', err)
|
|
81
|
+
// });
|
|
82
|
+
if (this.stash === 'integration') {
|
|
83
|
+
await integrationLogout()
|
|
84
|
+
} else {
|
|
85
|
+
await compactLogout()
|
|
86
|
+
}
|
|
87
|
+
this.logoutUrl()
|
|
88
|
+
},
|
|
89
|
+
logoutUrl() {
|
|
90
|
+
localStorage.clear();
|
|
91
|
+
sessionStorage.clear();
|
|
92
|
+
location.href = this.stash === 'integration' ? '/admin-ui/login' : '/#/login'
|
|
81
93
|
},
|
|
82
94
|
getName () {
|
|
83
95
|
return getUserName()
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import request from 'axios'
|
|
2
|
+
// 一体化退出登录
|
|
3
|
+
export async function integrationLogout() {
|
|
4
|
+
return request({
|
|
5
|
+
url: '/admin-api/system/auth/logout',
|
|
6
|
+
method: 'post'
|
|
7
|
+
})
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// 轻量级退出登录
|
|
11
|
+
export async function compactLogout() {
|
|
12
|
+
return request({
|
|
13
|
+
url: '/auth/token/logout',
|
|
14
|
+
method: 'delete'
|
|
15
|
+
})
|
|
16
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import getStore from './userInfo';
|
|
3
3
|
import { checkToken } from './permessionUtils';
|
|
4
|
-
let tokenValue = '
|
|
4
|
+
let tokenValue = '606341ce3cc6457688fcbaf227686124';
|
|
5
5
|
axios.interceptors.response.use(
|
|
6
6
|
(response) => {
|
|
7
7
|
if (response.status === 200) {
|
|
@@ -32,7 +32,7 @@ axios.interceptors.response.use(
|
|
|
32
32
|
// 其他错误处理
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
console.log('=========', JSON.stringify(error
|
|
35
|
+
console.log('=========', JSON.stringify(error))
|
|
36
36
|
return Promise.reject(error.response);
|
|
37
37
|
},
|
|
38
38
|
);
|
package/vue.config.js
CHANGED
|
@@ -26,11 +26,11 @@ module.exports = {
|
|
|
26
26
|
"^/": "/",
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
|
-
'/admin-api': {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
29
|
+
// '/admin-api': {
|
|
30
|
+
// target: 'http://10.136.106.131:30097',
|
|
31
|
+
// changeOrigin: true,
|
|
32
|
+
// pathRewrite: { '^': '' },
|
|
33
|
+
// }
|
|
34
34
|
// 3.5 以后不需要再配置
|
|
35
35
|
},
|
|
36
36
|
},
|