From eecccd16014c9b14eb5c74e95a3ee5f3ba9b36b0 Mon Sep 17 00:00:00 2001 From: zer0Black <694429613@qq.com> Date: Sun, 17 Apr 2022 16:18:16 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90fix=E3=80=91=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=96=E9=83=A8=E8=BF=9E=E6=8E=A5=E6=97=A0=E6=B3=95=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-web/src/utils/util.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jero-web/src/utils/util.js b/jero-web/src/utils/util.js index 43cb650b..23f06c77 100644 --- a/jero-web/src/utils/util.js +++ b/jero-web/src/utils/util.js @@ -84,7 +84,7 @@ export function formatDate(value, fmt) { // 生成首页路由 export function generateIndexRouter(data) { const redirectPath = findFirstRoute(data) -let indexRouter = [{ + let indexRouter = [{ path: '/', name: 'dashboard', //component: () => import('@/components/layouts/BasicLayout'), @@ -111,10 +111,9 @@ function generateChildRouters (data) { }else{ component = "views/"+item.component; } - // eslint-disable-next-line let URL = (item.meta.url|| '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量 - if (isURL(URL)) { + if (isURL(URL) || (item.meta.url && item.meta.url.indexOf("{{") == 0)) { item.meta.url = URL; }