调整登录逻辑退出登录调整拦截器新增路由通配404也买呢

This commit is contained in:
唐明明
2021-09-28 17:14:21 +08:00
parent e9343f9085
commit 730187e1d2
45 changed files with 598 additions and 426 deletions

View File

@@ -18,7 +18,11 @@ const router = createRouter({
paramsToQuery: true
},
platform: process.env.VUE_APP_PLATFORM,
routes: [...ROUTES]
routes: [...ROUTES, {
path: '*',
name:'404',
component: ()=> import('@/pages/404/404')
}]
})
// 全局路由前置守卫
@@ -27,7 +31,10 @@ router.beforeEach((to, from, next) => {
// 检查是否需要登录
if(to.auth && token === ''){
next({
name: 'Login'
name: 'Login',
params: {
toName: to.name
}
})
return
}