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 })