From b413394a0a4bdbb2b3af67f3faf86b3b7351655a Mon Sep 17 00:00:00 2001 From: jazz <jazzxhunter@163.com> Date: 星期三, 24 八月 2022 11:20:31 +0800 Subject: [PATCH] update_202208241120_临时发送添加短信类型 --- src/router/index.js | 49 ++++++++++++++++++++++++++++++++----------------- 1 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index ebfad34..2c5a36e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -6,9 +6,11 @@ /* Layout */ import Layout from '@/layout' -import demo_router from './demo_router' -import system_router from './system_router' -import op_router from './op_router' +// import demo_router from './demo_router' +import sms_router from './sms_router' +// import system_router from './system_router' +// import op_router from './op_router' +// import agreement_router from './agreement_router' /** * 娉�:瀛愯彍鍗曞彧鍑虹幇鍦ㄨ矾绾垮瓙鏃躲�傞暱搴�> = 1 @@ -59,20 +61,22 @@ }] }, - system_router, - demo_router, + // system_router, + sms_router, + // demo_router, + // agreement_router, - { - path: 'external-link', - component: Layout, - children: [ - { - path: 'https://panjiachen.github.io/vue-element-admin-site/#/', - meta: { title: '澶栭摼', icon: 'link' }, - auth: 'external_link' - } - ] - }, + // { + // path: 'external-link', + // component: Layout, + // children: [ + // { + // path: 'https://panjiachen.github.io/vue-element-admin-site/#/', + // meta: { title: '澶栭摼', icon: 'link' }, + // auth: 'external_link' + // } + // ] + // }, // { // path: '/demo', @@ -87,7 +91,7 @@ // ] // }, - op_router, + // op_router, // 404 page must be placed at the end !!! { path: '*', redirect: '/404', hidden: true } @@ -101,6 +105,17 @@ const router = createRouter() +// 瀹堝崼锛屽鐞唊eepAlive鍛ㄦ湡锛岀敤isBack鏍囪鏄惁灞炰簬浠庡睘椤甸潰鍚庨�� +router.beforeEach(function(to, from, next) { + // 鍒ゆ柇鏄惁浠庝粠灞為〉闈㈠悗閫� + if (to.meta.keepAlive && from.meta.activeMenu === to.path) { + to.meta.isBack = true + } else { + to.meta.isBack = false + } + next(true) +}) + // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 export function resetRouter() { const newRouter = createRouter() -- Gitblit v1.8.0