module-menu-vue 0.0.18 → 0.0.20
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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<div class='menuIcon' @click="showMenuList = !showMenuList">
|
|
5
5
|
<img class="menuIcon_img" :src="menuIconSrc" />
|
|
6
6
|
</div>
|
|
7
|
-
<div class="menu_title_content" v-show="showCollapse">
|
|
7
|
+
<div class="menu_title_content" v-show="showCollapse" @click="toHref()">
|
|
8
8
|
<img class="menu_title_content_img" :src="getLogoAndTitle().logoSrc" alt="logo" />
|
|
9
9
|
<span class="menu_title">{{getLogoAndTitle().title}}</span>
|
|
10
10
|
</div>
|
|
@@ -79,6 +79,11 @@ export default {
|
|
|
79
79
|
this.getNewMenuList();
|
|
80
80
|
},
|
|
81
81
|
methods: {
|
|
82
|
+
toHref () {
|
|
83
|
+
if (this.sysName === 'admin') {
|
|
84
|
+
this.$router.push({path: '/admin/user/index'})
|
|
85
|
+
}
|
|
86
|
+
},
|
|
82
87
|
getSessionMenu () {
|
|
83
88
|
const menuObj = JSON.parse(sessionStorage.getItem('bigdata-menu'));
|
|
84
89
|
if (menuObj) {
|
|
@@ -57,7 +57,7 @@ export default {
|
|
|
57
57
|
if (flag === 'single') {
|
|
58
58
|
url = '/#/info/index'
|
|
59
59
|
} else if (flag === 'message') {
|
|
60
|
-
url = '
|
|
60
|
+
url = '/alert'
|
|
61
61
|
} else if (flag === 'systerm') {
|
|
62
62
|
url = '/#/admin/user/index'
|
|
63
63
|
} else if (flag === 'logout') {
|
|
@@ -69,22 +69,24 @@ export default {
|
|
|
69
69
|
const config = {
|
|
70
70
|
headers: {}
|
|
71
71
|
}
|
|
72
|
-
const TENANT_ID = getStore({ name: "tenantId" }) || '1';
|
|
72
|
+
// const TENANT_ID = getStore({ name: "tenantId" }) || '1';
|
|
73
73
|
const isToken = (config.headers || {}).isToken === false;
|
|
74
74
|
const token = getStore({ name: 'access_token' });
|
|
75
75
|
if (token && !isToken) {
|
|
76
76
|
config.headers["Authorization"] = `Bearer ${token}`; // token
|
|
77
77
|
}
|
|
78
|
-
if (TENANT_ID) {
|
|
79
|
-
|
|
80
|
-
}
|
|
78
|
+
// if (TENANT_ID) {
|
|
79
|
+
// config.headers["TENANT-ID"] = TENANT_ID; // 租户ID
|
|
80
|
+
// }
|
|
81
|
+
sessionStorage.clear();
|
|
82
|
+
localStorage.clear();
|
|
81
83
|
axios({
|
|
82
84
|
method: 'delete',
|
|
83
85
|
url: '/auth/token/logout',
|
|
84
86
|
...config
|
|
85
87
|
}).then(res => {
|
|
86
88
|
console.log('res', res)
|
|
87
|
-
|
|
89
|
+
this.$router.push({ path: "/login" });
|
|
88
90
|
}).catch((err) => {
|
|
89
91
|
console.error(err)
|
|
90
92
|
})
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import request from 'axios'
|
|
2
|
-
import { Message } from 'element-ui';
|
|
3
|
-
const DEFAULT_LOGOUT_URL = '/#/login'
|
|
4
2
|
export const logout = () => {
|
|
5
3
|
return request({
|
|
6
4
|
url: '/auth/token/logout',
|
|
7
5
|
method: 'delete'
|
|
8
6
|
})
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// 校验token是否失效
|
|
12
|
-
export const checkToken = (token) => {
|
|
13
|
-
return request({
|
|
14
|
-
url: `/auth/oauth/check_token?token=${token}`,
|
|
15
|
-
method: 'get'
|
|
16
|
-
}).then().catch(() => {
|
|
17
|
-
Message.error({content:'用户凭证已过期,请重新登录', onClose: ()=>{
|
|
18
|
-
localStorage.clear();
|
|
19
|
-
sessionStorage.clear();
|
|
20
|
-
window.location.href = DEFAULT_LOGOUT_URL;
|
|
21
|
-
}});
|
|
22
|
-
})
|
|
23
7
|
}
|