mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-15 14:03:36 +08:00
fix: some bug
This commit is contained in:
@@ -120,13 +120,12 @@ export function resetRouter() {
|
||||
|
||||
import NProgress from "../utils/progress";
|
||||
|
||||
// const whiteList = ["/login", "/register"];
|
||||
const whiteList = ["/login", "/register"];
|
||||
|
||||
router.beforeEach((to, _from, next) => {
|
||||
const name = storageSession.getItem("info");
|
||||
NProgress.start();
|
||||
const { t } = i18n.global;
|
||||
// @ts-ignore
|
||||
to.meta.title ? (document.title = t(to.meta.title)) : ""; // 动态title
|
||||
if (name) {
|
||||
if (_from?.name) {
|
||||
@@ -140,7 +139,11 @@ router.beforeEach((to, _from, next) => {
|
||||
}
|
||||
} else {
|
||||
if (to.path !== "/login") {
|
||||
next({ path: "/login" });
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next();
|
||||
} else {
|
||||
next({ path: "/login" });
|
||||
}
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
|
||||
@@ -21,20 +21,6 @@ const remainingRouter = [
|
||||
rank: 102
|
||||
}
|
||||
},
|
||||
// {
|
||||
// // 找不到路由重定向到404页面
|
||||
// path: "/:pathMatch(.*)",
|
||||
// name: "pathMatch",
|
||||
// component: Layout,
|
||||
// redirect: "/error/404",
|
||||
// meta: {
|
||||
// icon: "el-icon-s-home",
|
||||
// title: "message.hshome",
|
||||
// showLink: false,
|
||||
// savedPosition: false,
|
||||
// rank: 103,
|
||||
// },
|
||||
// },
|
||||
{
|
||||
path: "/redirect",
|
||||
name: "redirect",
|
||||
|
||||
Reference in New Issue
Block a user