Commit 036e934a authored by 李鹏 's avatar 李鹏

modify

parent c2cd7c2d
......@@ -6,6 +6,7 @@ import store from "../store";
//写入初始必须有的路由
//或者隐藏式路由,不会表现在菜单上,但是需要存在的路由
<<<<<<< Updated upstream
const routes = [{
path: "/login",
name: "login",
......@@ -39,6 +40,31 @@ const routes = [{
component: () =>
import ("../page/404.vue"),
},
=======
const routes = [
{
path: "/login",
name: "login",
show: true,
component: () => import("../page/login/index.vue"),
},
{
path: "/register",
name: "register",
show: true,
component: () => import("../page/register/index.vue"),
},
{
path: "/",
name: "index",
component: () => import("../page/welcom.vue"),
},
{
path: "/404",
show: true,
component: () => import("../page/404.vue"),
},
>>>>>>> Stashed changes
];
//重新创建router
......@@ -63,6 +89,16 @@ function inWhiteList(toPath) {
}
router.beforeEach((to, from, next) => {
<<<<<<< Updated upstream
=======
const userInfo = store.state.userInfo;
//已登录不可跳转登陆页 || to.path == "/" 去除首页跳转判断
if (userInfo && to.path == "/login") {
return next({
path: "/",
});
}
>>>>>>> Stashed changes
const userInfo = store.state.userInfo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment