From 4cf74834fe5ac6229035b72312b75958495e60d3 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期二, 19 八月 2025 15:35:08 +0800
Subject: [PATCH] 1
---
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