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 | 33 +++++++++++++++++++++++++++++----
1 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/src/router/index.js b/src/router/index.js
index 4a05f71..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 */
@@ -38,7 +38,7 @@
children: [
{
path: '/redirect/:path(.*)',
- component: () => import('@/views/redirect')
+ component: () => import('@/views/redirect'),
},
{
path: '/emer',
@@ -145,6 +145,12 @@
name: 'DailyReportReport',
meta: { title: '', activeMenu: '/bre/zongjianjiankangzheng ' },
},
+ {
+ path: 'clinical',
+ component: () => import('@/views/jmreport/jmreport/clinical'),
+ name: 'DailyReportReport',
+ meta: { title: '妫�楠岀瀵兼鍗�', activeMenu: '/bre/clinical' },
+ },
]
},
{
@@ -203,7 +209,8 @@
path: 'index',
component: () => import('@/views/index'),
name: 'Index',
- meta: { title: '棣栭〉', icon: 'dashboard', affix: true }
+ meta: { title: '棣栭〉', icon: 'dashboard', affix: true ,}
+ // routerType:"xamjyy",
}
]
},
@@ -404,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