|
@@ -9,27 +9,24 @@ router.beforeEach((to, from, next) => {
|
|
|
// from 从哪个路径跳转过来的
|
|
|
// next 是一个函数,代表放行
|
|
|
document.title = `${to.meta.title} | 全业务域对标考评系统`
|
|
|
- // if (to.query.markKey === "YXSSO") {
|
|
|
+
|
|
|
+ // let token = window.localStorage.getItem('token')
|
|
|
+
|
|
|
+ // if(to.path==='/login'){
|
|
|
// return next()
|
|
|
- // } else {
|
|
|
- // let token = getToken('token')
|
|
|
- let token = window.localStorage.getItem('token')
|
|
|
-
|
|
|
- if(to.path==='/login'){
|
|
|
- return next()
|
|
|
- }else{
|
|
|
- if(!token){
|
|
|
- ElMessage.error('登录已失效,请重新登录');
|
|
|
- store.commit('clearAxiosArr')
|
|
|
- return next('/login')
|
|
|
- } else if (to.path==='/') {
|
|
|
- store.commit('clearAxiosArr')
|
|
|
- return next('/login')
|
|
|
- } else{
|
|
|
- store.commit('clearAxiosArr')
|
|
|
- next()
|
|
|
- }
|
|
|
- }
|
|
|
+ // }else{
|
|
|
+ // if(!token){
|
|
|
+ // ElMessage.error('登录已失效,请重新登录');
|
|
|
+ // store.commit('clearAxiosArr')
|
|
|
+ // return next('/login')
|
|
|
+ // } else if (to.path==='/') {
|
|
|
+ // store.commit('clearAxiosArr')
|
|
|
+ // return next('/login')
|
|
|
+ // } else{
|
|
|
+ // store.commit('clearAxiosArr')
|
|
|
+ // next()
|
|
|
+ // }
|
|
|
// }
|
|
|
- // return next()
|
|
|
+
|
|
|
+ return next()
|
|
|
})
|