diff --git a/rsbuild.config.ts b/rsbuild.config.ts index 6b85ecc505f4b4dadacc00a7c3a0178f37063113..f7725663b3ea6b3e2c60594bac84a63b7fe17cd4 100644 --- a/rsbuild.config.ts +++ b/rsbuild.config.ts @@ -60,7 +60,8 @@ function getPages(pageList) { console.log(JSON.stringify(getPages(process.env.VUE_APP_PAGE_LIST), null, 2)); const pages = getPages(process.env.VUE_APP_PAGE_LIST); -const ent = Object.fromEntries(Object.keys(pages).map(key => [tenantName + '/' + key, pages[key].entry])); +let tenantNames = process.env.NODE_ENV === 'development' ? tenantName : ''; +const ent = Object.fromEntries(Object.keys(pages).map(key => [tenantNames + '/' + key, pages[key].entry])); export default defineConfig({ plugins: [pluginVue2()], @@ -153,5 +154,15 @@ export default defineConfig({ chunkSplit: { strategy: 'split-by-size' } + }, + output: { + distPath: { + image: 'resource/images', + svg: 'resource/images', + font: 'resource/fonts', + js: 'resource/js', + wasm: 'resource/js', + css: 'resource/css' + } } }); diff --git a/src/resources/assets/js/util.js b/src/resources/assets/js/util.js index 8a607e400450ab171e1642edd291d26b24cfcfeb..f9fa1627f64aec290964dd97d32685de6f6157df 100644 --- a/src/resources/assets/js/util.js +++ b/src/resources/assets/js/util.js @@ -995,18 +995,11 @@ const methods = { return text; }, handleTopoImagePath(nodesString) { - /** - * 处理cmdb拓补图图片路径,本地开发环境,图片路径需带上租户,否则图片显示不出来 - * 获取image=最后一个/后的值,然后拼接resource/img/topo静态资源文件路径 - */ if (!nodesString) { return ''; } - let regex = /image="(?:\/resource\/img\/icons\/|\/)([^\/"]+)"/g; // 正则匹配 image="/resource/img/icons/xxxxx.xxx.png" 或者 image="/xxxx.xxxx.png" 取最后一个/后的值 - let newNodesString = nodesString.replace(regex, (match, imageName) => { - let imagePath = `resource/img/topo/${imageName}`; - let newImagePath = process.env.NODE_ENV === 'development' ? `${process.env.VUE_APP_TENANT}/${imagePath}` : `${imagePath}`; - return `image="/${newImagePath}"`; + let newNodesString = nodesString.replace(/image="(?:\/resource\/img\/icons\/|\/)([^\/"]+)"/g, (match, imageName) => { + return `image="/resource/img/topo/${imageName}"`; }); return newNodesString; }, diff --git a/src/resources/components/TsTable/TsTable.vue b/src/resources/components/TsTable/TsTable.vue index 77c97962f2fc38e35925b95407322d2fb48c57c2..c3a8594a6f38a14255b73bee532c57145b18c4fc 100644 --- a/src/resources/components/TsTable/TsTable.vue +++ b/src/resources/components/TsTable/TsTable.vue @@ -506,7 +506,7 @@ export default { styleType: { //table样式类型,支持多个类型空格隔开的字符串。跟type的区别是type针对排版块状还是列表,styleType针对普通的table常用的样式比如线条还是斑马支持多个字符串 [border,stripe] type: String, - default: process.env.VUE_APP_TABLESTRYLE || 'border' + default: (process.env && process.env.VUE_APP_TABLESTRYLE) || 'border' }, loading: { type: Boolean, diff --git a/src/resources/store/modules/topMenu.js b/src/resources/store/modules/topMenu.js index 8849e03e579ff618a1a37891271d7407a2b4ba88..3f91fbd8f4db54f52054fab52d5cc1280b2d0f77 100644 --- a/src/resources/store/modules/topMenu.js +++ b/src/resources/store/modules/topMenu.js @@ -48,7 +48,7 @@ const actions = { const res = await state.gettingModuleList; const userRes = await commonApi.getUser(); let showModuleList = null; //可以显示的模块,如果不是单独命令行的就默认null全部需要展示,如果有单独配置的获取配置 - if (process.env.VUE_APP_PAGE_LIST && JSON.parse(process.env.VUE_APP_PAGE_LIST)) { + if (process.env && process.env.VUE_APP_PAGE_LIST && JSON.parse(process.env.VUE_APP_PAGE_LIST)) { //如果是指定编译模块的,要过滤掉不在模块列表里的 showModuleList = JSON.parse(process.env.VUE_APP_PAGE_LIST); } diff --git a/src/views/pages/login/Login.vue b/src/views/pages/login/Login.vue index 2b2a011a5f9ba81652d9e9a27b01b0bc926b1a4b..20bdcfa2d54ebbadc6d544af5ff67514d7f20337 100644 --- a/src/views/pages/login/Login.vue +++ b/src/views/pages/login/Login.vue @@ -53,7 +53,11 @@
{{ $t('page.language') }} - + {{ themeClass == 'theme-default' ? $t('page.themedark'): $t('page.themelight') }}
@@ -62,7 +66,7 @@