From 1c503a69c913fe4b9473f3b74a394444bcfeb4bb Mon Sep 17 00:00:00 2001 From: 24kycj <1637269896@qq.com> Date: Wed, 22 Oct 2025 17:34:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=9A=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E7=9B=B8=E5=AF=B9=E8=B7=AF=E5=BE=84=E5=AF=BC=E5=85=A5=20fileSi?= =?UTF-8?q?ze=20=E5=B7=A5=E5=85=B7=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=89=93?= =?UTF-8?q?=E5=8C=85=E5=88=AB=E5=90=8D=E8=A7=A3=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 '@/utils/fileSize' 全部改为相对路径导入,兼容打包环境 - 修复 store 与页面中别名解析失败导致的模块找不到问题 - 保持逻辑不变,仅调整导入路径,降低打包风险 --- src/renderer/store/modules/chat.js | 4 ++-- src/renderer/views/dashboard/index.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/store/modules/chat.js b/src/renderer/store/modules/chat.js index 32c9355..78d79ee 100644 --- a/src/renderer/store/modules/chat.js +++ b/src/renderer/store/modules/chat.js @@ -1,5 +1,4 @@ // import { getAllList, getChatList, bindId, chatBegin } from '@/api/message' -import { getCurrentOSDiscTypes } from '@/utils/fileSize' let timeouter = null let websock = null @@ -130,7 +129,8 @@ const CDTypes = { 6: 'BD_TL', 7: 'BD_QL' } -// 使用跨平台文件大小计算 +// 使用跨平台文件大小计算(相对路径) +const { getCurrentOSDiscTypes } = require('../../utils/fileSize') const cd_types = getCurrentOSDiscTypes() const defaultData = { diff --git a/src/renderer/views/dashboard/index.vue b/src/renderer/views/dashboard/index.vue index 1cc05ed..c246338 100644 --- a/src/renderer/views/dashboard/index.vue +++ b/src/renderer/views/dashboard/index.vue @@ -341,7 +341,6 @@ import { mapGetters } from 'vuex' const { app, dialog } = require('@electron/remote') import UserInfo from '@/components/userInfo/userInfo.vue' import WorkAdd from '@/components/workAdd/workAdd.vue' -import { getCurrentOSDiscTypes } from '@/utils/fileSize' const exePath = !app.isPackaged ? process.cwd() : path.dirname(process.execPath) const shPath = path.join(exePath, 'CardsoonServer', 'control.sh') const activePath = path.join(exePath, 'CardsoonServer', 'regist.sh') @@ -972,6 +971,7 @@ export default { that.currentRunVal = 0 // 使用跨平台文件大小计算(相对路径) + const { getCurrentOSDiscTypes } = require('../../utils/fileSize') let typeLists = getCurrentOSDiscTypes() let isBD = that.changeCD.req_info.strong_list.findIndex(item => parseInt(item.strong_type) > 3) if (isBD === -1) {