Issue #140:
This commit is contained in:
@@ -82,10 +82,6 @@ router.beforeEach((to, from) => {
|
||||
// from: Route: 當前導航正要離開的路由
|
||||
let isCookie = document.cookie.split(';').some(c => c.trim().startsWith('luciaToken=')); // 是否登入
|
||||
|
||||
// 需要驗證登入的頁面,判斷有無登入,無登入要轉址 login
|
||||
if(to.meta.requiresAuth) {
|
||||
if (!isCookie) router.push({ name: 'Login' });
|
||||
}
|
||||
// 當路由到 login 時,有登入要跳轉至home
|
||||
if (to.name === 'Login') {
|
||||
if (isCookie) router.push({ name: 'Files' });
|
||||
|
||||
Reference in New Issue
Block a user