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