【fix】修复外部连接无法访问的问题

This commit is contained in:
zer0Black
2022-04-17 16:18:16 +08:00
parent 3c496456b4
commit eecccd1601
+2 -3
View File
@@ -84,7 +84,7 @@ export function formatDate(value, fmt) {
// 生成首页路由 // 生成首页路由
export function generateIndexRouter(data) { export function generateIndexRouter(data) {
const redirectPath = findFirstRoute(data) const redirectPath = findFirstRoute(data)
let indexRouter = [{ let indexRouter = [{
path: '/', path: '/',
name: 'dashboard', name: 'dashboard',
//component: () => import('@/components/layouts/BasicLayout'), //component: () => import('@/components/layouts/BasicLayout'),
@@ -111,10 +111,9 @@ function generateChildRouters (data) {
}else{ }else{
component = "views/"+item.component; component = "views/"+item.component;
} }
// eslint-disable-next-line // eslint-disable-next-line
let URL = (item.meta.url|| '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量 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; item.meta.url = URL;
} }