From a2931feea2ab14173fa6ed54b3b556bcb79f7984 Mon Sep 17 00:00:00 2001 From: dhy1725534722 <1725534722@qq.com> Date: Mon, 31 Jul 2023 14:23:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 24 +++++++++++++----------- src/router/index.js | 28 ++++++++++++++++++++++++++++ src/views/index.vue | 4 +++- 3 files changed, 44 insertions(+), 12 deletions(-) diff --git a/src/permission.js b/src/permission.js index a944c05..52fea0a 100644 --- a/src/permission.js +++ b/src/permission.js @@ -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(); } } diff --git a/src/router/index.js b/src/router/index.js index 5e935fd..21abf03 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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" }, + }, ], }, ]; diff --git a/src/views/index.vue b/src/views/index.vue index a1ef2ae..4fe5c08 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -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() {},