|
@@ -5,11 +5,11 @@ import { getParentLayout, LAYOUT, EXCEPTION_COMPONENT } from '/@/router/constant
|
|
|
import { cloneDeep, omit } from 'lodash-es';
|
|
|
import { warn } from '/@/utils/log';
|
|
|
import { createRouter, createWebHashHistory } from 'vue-router';
|
|
|
-import { getTenantId, getToken } from "/@/utils/auth";
|
|
|
+import { getTenantId, getToken } from '/@/utils/auth';
|
|
|
import { URL_HASH_TAB, _eval } from '/@/utils';
|
|
|
//引入online lib路由
|
|
|
import { packageViews } from '/@/utils/monorepo/dynamicRouter';
|
|
|
-import {useI18n} from "/@/hooks/web/useI18n";
|
|
|
+import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
|
|
|
export type LayoutMapKey = 'LAYOUT';
|
|
|
const IFRAME = () => import('/@/views/sys/iframe/FrameBlank.vue');
|
|
@@ -33,12 +33,11 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) {
|
|
|
}
|
|
|
if (!routes) return;
|
|
|
routes.forEach((item) => {
|
|
|
-
|
|
|
//【jeecg-boot/issues/I5N2PN】左侧动态菜单怎么做国际化处理 2022-10-09
|
|
|
//菜单支持国际化翻译
|
|
|
if (item?.meta?.title) {
|
|
|
const { t } = useI18n();
|
|
|
- if(item.meta.title.includes('t(\'') && t){
|
|
|
+ if (item.meta.title.includes("t('") && t) {
|
|
|
// update-begin--author:liaozhiyang---date:20230906---for:【QQYUN-6390】eval替换成new Function,解决build警告
|
|
|
item.meta.title = new Function('t', `return ${item.meta.title}`)(t);
|
|
|
// update-end--author:liaozhiyang---date:20230906---for:【QQYUN-6390】eval替换成new Function,解决build警告
|
|
@@ -61,7 +60,10 @@ function asyncImportRoute(routes: AppRouteRecordRaw[] | undefined) {
|
|
|
let tenantId = getTenantId();
|
|
|
// URL支持{{ window.xxx }}占位符变量
|
|
|
//update-begin---author:wangshuai ---date:20220711 for:[VUEN-1638]菜单tenantId需要动态生成------------
|
|
|
- item.component = (item.component || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => _eval(s2)).replace('${token}', token).replace('${tenantId}', tenantId);
|
|
|
+ item.component = (item.component || '')
|
|
|
+ .replace(/{{([^}}]+)?}}/g, (s1, s2) => _eval(s2))
|
|
|
+ .replace('${token}', token)
|
|
|
+ .replace('${tenantId}', tenantId);
|
|
|
//update-end---author:wangshuai ---date:20220711 for:[VUEN-1638]菜单tenantId需要动态生成------------
|
|
|
// 适配 iframe
|
|
|
if (/^\/?http(s)?/.test(item.component as string)) {
|