mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-12-15 14:50:29 +08:00
perf: 减少代码重复
This commit is contained in:
@@ -188,16 +188,12 @@ router.beforeEach((to: ToRouteType, _from, next) => {
|
|||||||
toCorrectRoute();
|
toCorrectRoute();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (to.path !== "/login") {
|
if (to.path === "/login" || whiteList.includes(to.path)) {
|
||||||
if (whiteList.indexOf(to.path) !== -1) {
|
|
||||||
next();
|
next();
|
||||||
} else {
|
} else {
|
||||||
removeToken();
|
removeToken();
|
||||||
next({ path: "/login" });
|
next({ path: "/login" });
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
next();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user