feat: 新增页面布局
This commit is contained in:
@@ -12,6 +12,12 @@ const routes = [
|
||||
component: () => import("@/views/browser/BrowserLayout.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: "/home",
|
||||
name: "Home",
|
||||
component: () => import("@/views/home/index.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
name: "About",
|
||||
@@ -30,10 +36,12 @@ router.beforeEach((to, _from, next) => {
|
||||
next({ path: "/login" });
|
||||
return;
|
||||
}
|
||||
if (token && to.path !== "/browser") {
|
||||
next({ path: "/browser" });
|
||||
|
||||
if (token && to.path !== "/home") {
|
||||
next({ path: "/home" });
|
||||
return;
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user