prod
lily.zhang 3 years ago
parent a4b6335583
commit 13ba69591f

@ -47,10 +47,10 @@
<a-icon type="down" />
</a>
<a-menu slot="overlay">
<a-menu-item>
<span @click="handlerMyself"></span>
<a-menu-item @click="handlerMyself">
<span>个人中</span>
</a-menu-item>
<a-menu-item>
<a-menu-item @click="layout">
<span>退出</span>
</a-menu-item>
</a-menu>
@ -163,6 +163,12 @@ export default {
sEndTime: val[1]
}
this.setCommTime(obj);
},
// 退
layout() {
this.setToken("");
this.setUser({});
this.$router.replace("/login");
}
},
};

@ -1,11 +1,25 @@
/*
* @Author: your name
* @Date: 2021-10-08 09:26:42
* @LastEditTime: 2021-10-23 17:40:41
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /data-show/src/permission.js
*/
import router from "@/router"
import NProgress from "nprogress"
import "nprogress/nprogress.css"
const whitePath = ['/', '/login', '/industryDataExport','/index']
const token = sessionStorage.getItem('token');
router.beforeEach((to, from, next) => {
// console.log(to,from, next)
NProgress.start()
next()
if(!token && !whitePath.includes(to.path)) {
next('/login');
} else {
NProgress.start()
next()
}
})
router.afterEach(() => {

Loading…
Cancel
Save