Lvtianfang
杜函宇 2 years ago
parent 4da1aca2f1
commit a2931feea2

@ -6,11 +6,11 @@ import "nprogress/nprogress.css";
import { getToken } from "@/utils/auth";
// 踢出系统
function kickOut() {
if (process.env.NODE_ENV === "production") {
location.href = location.origin + "/login";
}
}
// function kickOut() {
// if (process.env.NODE_ENV === "production") {
// location.href = location.origin + "/login";
// }
// }
NProgress.configure({ showSpinner: false });
const whiteList = [
"/login",
@ -55,20 +55,22 @@ router.beforeEach((to, from, next) => {
if (res.length > 0) {
next({ path: res });
} else {
kickOut();
// kickOut();
}
})
.catch((error) => {
kickOut();
// kickOut();
});
}
} else {
//没有token踢出去
Message.error("获取令牌失败!");
kickOut();
// //没有token踢出去
// Message.error("获取令牌失败!");
// kickOut();
next();
}
} else {
kickOut();
// kickOut();
NProgress.done();
}
}

@ -120,6 +120,34 @@ export const constantRoutes = [
component: () => import("@/views/changePassword/index"),
meta: { title: "修改密码", icon: "netWork" },
},
{
path: "/changePassword",
name: "行政审批",
icon: require("@/assets/images/tree4.svg"),
component: () => import("@/views/changePassword/index"),
meta: { title: "行政审批", icon: "netWork" },
},
{
path: "/changePassword",
name: "企业档案",
icon: require("@/assets/images/tree4.svg"),
component: () => import("@/views/changePassword/index"),
meta: { title: "企业档案", icon: "netWork" },
},
{
path: "/changePassword",
name: "产品档案",
icon: require("@/assets/images/tree4.svg"),
component: () => import("@/views/changePassword/index"),
meta: { title: "产品档案", icon: "netWork" },
},
{
path: "/changePassword",
name: "依法注销",
icon: require("@/assets/images/tree4.svg"),
component: () => import("@/views/changePassword/index"),
meta: { title: "依法注销", icon: "netWork" },
},
],
},
];

@ -38,11 +38,13 @@ export default {
computed: {
//
myRouter() {
console.log(this.$router.options.routes);
// let staticRouter = router.options.routes.filter(
// (item) => item.isDiy == true
// )[0].children;
// return staticRouter;
return this.$store.state.myselfPermission.routerList;
// return this.$store.state.myselfPermission.routerList;
return this.$router.options.routes[6].children;
},
},
created() {},

Loading…
Cancel
Save