From 16100d1ffa4bb7911821e90fe7eebea088a16b00 Mon Sep 17 00:00:00 2001 From: zhuhao <979263092@qq.com> Date: Mon, 20 Jan 2025 14:56:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E7=9C=81=E4=BB=BD=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - src/renderer/index.html | 2 +- src/renderer/src/main.js | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 36ad7fb..a5b5a0d 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,6 @@ "electron-log": "^5.1.7", "electron-store": "8.0.0", "electron-updater": "^6.1.7", - "element-china-area-data": "^6.1.0", "element-plus": "^2.8.0", "fabric": "^5.3.0", "file-saver": "^2.0.5", diff --git a/src/renderer/index.html b/src/renderer/index.html index aefa0c5..bfa9a4f 100644 --- a/src/renderer/index.html +++ b/src/renderer/index.html @@ -14,7 +14,7 @@
- + diff --git a/src/renderer/src/main.js b/src/renderer/src/main.js index ed69fbe..e4529ee 100644 --- a/src/renderer/src/main.js +++ b/src/renderer/src/main.js @@ -70,6 +70,21 @@ VMdPreview.use(githubTheme, { } })() + +let script = document.createElement('script'); +if (process.env.NODE_ENV !== 'development') { + const isNode = typeof require !== 'undefined' // 是否支持node函数 + const path = isNode?require('path'):{} +// 设置 src 属性 + script.src = path.join(__dirname, "/lib/build/aws-sdk-2.100.0.min.js"); +}else { + script.src = "https://sdk.amazonaws.com/js/aws-sdk-2.100.0.min.js"; +} +// 设置 async 属性,让脚本异步加载 +script.async = false; +// 将 script 元素添加到文档的 head 元素中 +document.head.appendChild(script); + app.use(router) .use(store) .use(ElementPlus, { locale: zhLocale })