From c9ad23c7cd434de056714b9d5c72db1083e9222d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Thu, 9 Jan 2025 13:07:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8C=BA=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 2 +- src/router/index.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.production b/.env.production index b9783b0..5a43625 100644 --- a/.env.production +++ b/.env.production @@ -10,5 +10,5 @@ VUE_APP_BASE_API = 'http://localhost:9002/api' #是否正式环境 正式true 测试false -VUE_APP_ISTEST= false +VUE_APP_ISTEST= true diff --git a/src/router/index.js b/src/router/index.js index b941674..b8e963e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -80,7 +80,9 @@ export let constantRoutes = [ constantRoutes = [...constantRoutes, ...getFilterRouter()]; // 动态路由,基于用户权限动态去加载 - 公司及本地环境 -export const dynamicRoutes = getFilterRouter(); +export const dynamicRoutes = JSON.parse(process.env.VUE_APP_ISTEST) + ? [] + : getFilterRouter(); // 防止连续点击多次路由报错 let routerPush = Router.prototype.push;