chore: save work before switching to dev
This commit is contained in:
@@ -95,7 +95,8 @@ router.beforeEach(async (to, from, next) => {
|
||||
} else {
|
||||
if (!token) {
|
||||
next(`/login?redirect=${to.path}¶ms=${JSON.stringify(to.query ? to.query : to.params)}`);
|
||||
Session.clear();
|
||||
// 进入受保护页面但本地已没有 token 时,只清理登录态缓存即可。
|
||||
Session.clearAuth();
|
||||
NProgress.done();
|
||||
} else if (token && to.path === '/login') {
|
||||
next('/home');
|
||||
|
||||
Reference in New Issue
Block a user