From 4c4abb59d6ee838c61b851fcc7be93c0522c39c4 Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期五, 04 七月 2025 16:36:13 +0800 Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb_region --- src/router/index.js | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 1f5425c..b024307 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,6 +1,6 @@ import Vue from 'vue' import Router from 'vue-router' - +import Cookies from "js-cookie"; Vue.use(Router) /* Layout */ @@ -144,6 +144,12 @@ component: () => import('@/views/jmreport/jmreport/zongjianjiankangzheng'), name: 'DailyReportReport', meta: { title: '', activeMenu: '/bre/zongjianjiankangzheng ' }, + }, + { + path: 'clinical', + component: () => import('@/views/jmreport/jmreport/clinical'), + name: 'DailyReportReport', + meta: { title: '妫�楠岀瀵兼鍗�', activeMenu: '/bre/clinical' }, }, ] }, @@ -405,8 +411,26 @@ return routerPush.call(this, location).catch(err => err) } -export default new Router({ +const router = new Router({ mode: 'history', // 鍘绘帀url涓殑# scrollBehavior: () => ({ y: 0 }), routes: constantRoutes }) + +router.beforeEach((to, from, next) => { + if (from.path === '/login') { + // 鑾峰彇褰撳墠鐜 + const env = process.env.VUE_APP_ENV + // 鐢熶骇鐜澶勭悊 + if (env === 'production') { + // 闃叉鐢ㄦ埛閫氳繃鍦板潃鏍忕洿鎺ヨ緭鍏RL璁块棶 + if (from.name === null && to.path !== window.location.pathname) { + next(false) + return + } + } + } + next() +}) + +export default router -- Gitblit v1.8.0