正在显示
8 个修改的文件
包含
222 行增加
和
142 行删除
| ... | @@ -9,6 +9,7 @@ const MinifyPlugin = require("babel-minify-webpack-plugin"); | ... | @@ -9,6 +9,7 @@ const MinifyPlugin = require("babel-minify-webpack-plugin"); |
| 9 | const CopyWebpackPlugin = require('copy-webpack-plugin') | 9 | const CopyWebpackPlugin = require('copy-webpack-plugin') |
| 10 | const MiniCssExtractPlugin = require('mini-css-extract-plugin') | 10 | const MiniCssExtractPlugin = require('mini-css-extract-plugin') |
| 11 | const HtmlWebpackPlugin = require('html-webpack-plugin') | 11 | const HtmlWebpackPlugin = require('html-webpack-plugin') |
| 12 | +const TerserPlugin = require('terser-webpack-plugin'); | ||
| 12 | const { VueLoaderPlugin } = require('vue-loader') | 13 | const { VueLoaderPlugin } = require('vue-loader') |
| 13 | 14 | ||
| 14 | function resolve(dir) { | 15 | function resolve(dir) { |
| ... | @@ -87,6 +88,7 @@ let webConfig = { | ... | @@ -87,6 +88,7 @@ let webConfig = { |
| 87 | use: { | 88 | use: { |
| 88 | loader: 'url-loader', | 89 | loader: 'url-loader', |
| 89 | query: { | 90 | query: { |
| 91 | + esModule: false, | ||
| 90 | limit: 10000, | 92 | limit: 10000, |
| 91 | name: 'imgs/[name].[ext]' | 93 | name: 'imgs/[name].[ext]' |
| 92 | } | 94 | } |
| ... | @@ -97,6 +99,7 @@ let webConfig = { | ... | @@ -97,6 +99,7 @@ let webConfig = { |
| 97 | use: { | 99 | use: { |
| 98 | loader: 'url-loader', | 100 | loader: 'url-loader', |
| 99 | query: { | 101 | query: { |
| 102 | + esModule: false, | ||
| 100 | limit: 10000, | 103 | limit: 10000, |
| 101 | name: 'fonts/[name].[ext]' | 104 | name: 'fonts/[name].[ext]' |
| 102 | } | 105 | } |
| ... | @@ -159,6 +162,50 @@ if (process.env.NODE_ENV === 'production') { | ... | @@ -159,6 +162,50 @@ if (process.env.NODE_ENV === 'production') { |
| 159 | minimize: true | 162 | minimize: true |
| 160 | }) | 163 | }) |
| 161 | ) | 164 | ) |
| 165 | + webConfig.optimization = { | ||
| 166 | + splitChunks: { | ||
| 167 | + chunks: "async", | ||
| 168 | + cacheGroups: { | ||
| 169 | + vendor: { // 将第三方模块提取出来 | ||
| 170 | + minSize: 30000, | ||
| 171 | + minChunks: 1, | ||
| 172 | + test: /node_modules/, | ||
| 173 | + chunks: 'initial', | ||
| 174 | + name: 'vendor', | ||
| 175 | + priority: 1 | ||
| 176 | + }, | ||
| 177 | + commons: { | ||
| 178 | + test: /[\\/]src[\\/]common[\\/]/, | ||
| 179 | + name: 'commons', | ||
| 180 | + minSize: 30000, | ||
| 181 | + minChunks: 3, | ||
| 182 | + chunks: 'initial', | ||
| 183 | + priority: -1, | ||
| 184 | + reuseExistingChunk: true // 这个配置允许我们使用已经存在的代码块 | ||
| 185 | + } | ||
| 186 | + } | ||
| 187 | + }, | ||
| 188 | + runtimeChunk: { name: 'runtime' }, | ||
| 189 | + minimizer: [ | ||
| 190 | + new TerserPlugin({ | ||
| 191 | + test: /\.js(\?.*)?$/i, | ||
| 192 | + extractComments: false, | ||
| 193 | + cache: false, | ||
| 194 | + sourceMap: false, | ||
| 195 | + terserOptions: { | ||
| 196 | + warnings: false, | ||
| 197 | + compress: { | ||
| 198 | + warnings: false, | ||
| 199 | + drop_console: true, | ||
| 200 | + drop_debugger: true, | ||
| 201 | + pure_funcs: ['console.log'] | ||
| 202 | + }, | ||
| 203 | + output: { | ||
| 204 | + comments: false, | ||
| 205 | + }, | ||
| 206 | + } | ||
| 207 | + })] | ||
| 208 | + } | ||
| 162 | } | 209 | } |
| 163 | 210 | ||
| 164 | module.exports = webConfig | 211 | module.exports = webConfig | ... | ... |
| ... | @@ -50,6 +50,7 @@ npm config edit | ... | @@ -50,6 +50,7 @@ npm config edit |
| 50 | 这是花裤衩大大原本的[地址](https://github.com/PanJiaChen/electron-vue-admin) | 50 | 这是花裤衩大大原本的[地址](https://github.com/PanJiaChen/electron-vue-admin) |
| 51 | 51 | ||
| 52 | # 更新日志 | 52 | # 更新日志 |
| 53 | +- 2020年04月29日:修复web打包失败,提升依赖;文档待完善 | ||
| 53 | - 2020年02月09日:添加[中文在线文档](https://umbrella22.github.io/electron-vue-template-doc/),[国内访问地址](https://zh-sky.gitee.io/electron-vue-template-doc/) | 54 | - 2020年02月09日:添加[中文在线文档](https://umbrella22.github.io/electron-vue-template-doc/),[国内访问地址](https://zh-sky.gitee.io/electron-vue-template-doc/) |
| 54 | - 剔除win打包依赖,因为太大了,将它放到码云的额外仓库中,[地址](https://gitee.com/Zh-Sky/HardToDownloadLib) | 55 | - 剔除win打包依赖,因为太大了,将它放到码云的额外仓库中,[地址](https://gitee.com/Zh-Sky/HardToDownloadLib) |
| 55 | - 2020年02月06日更新:激进分支更新至8.0.0. | 56 | - 2020年02月06日更新:激进分支更新至8.0.0. | ... | ... |
| ... | @@ -4,12 +4,6 @@ | ... | @@ -4,12 +4,6 @@ |
| 4 | "lockfileVersion": 1, | 4 | "lockfileVersion": 1, |
| 5 | "requires": true, | 5 | "requires": true, |
| 6 | "dependencies": { | 6 | "dependencies": { |
| 7 | - "7zip": { | ||
| 8 | - "version": "0.0.6", | ||
| 9 | - "resolved": "https://registry.npm.taobao.org/7zip/download/7zip-0.0.6.tgz", | ||
| 10 | - "integrity": "sha1-nK+xca+CMpSQNTtIFvAzR6oVCjA=", | ||
| 11 | - "dev": true | ||
| 12 | - }, | ||
| 13 | "7zip-bin": { | 7 | "7zip-bin": { |
| 14 | "version": "5.0.3", | 8 | "version": "5.0.3", |
| 15 | "resolved": "https://registry.npm.taobao.org/7zip-bin/download/7zip-bin-5.0.3.tgz", | 9 | "resolved": "https://registry.npm.taobao.org/7zip-bin/download/7zip-bin-5.0.3.tgz", |
| ... | @@ -3309,9 +3303,9 @@ | ... | @@ -3309,9 +3303,9 @@ |
| 3309 | } | 3303 | } |
| 3310 | }, | 3304 | }, |
| 3311 | "builder-util-runtime": { | 3305 | "builder-util-runtime": { |
| 3312 | - "version": "8.6.2", | 3306 | + "version": "8.7.0", |
| 3313 | - "resolved": "https://registry.npm.taobao.org/builder-util-runtime/download/builder-util-runtime-8.6.2.tgz", | 3307 | + "resolved": "https://registry.npm.taobao.org/builder-util-runtime/download/builder-util-runtime-8.7.0.tgz", |
| 3314 | - "integrity": "sha1-gnDhWwEtjTsRDz4yew/YsOB7FoY=", | 3308 | + "integrity": "sha1-5IrQBINcgoRmLo6vR6U0aMZujo0=", |
| 3315 | "requires": { | 3309 | "requires": { |
| 3316 | "debug": "^4.1.1", | 3310 | "debug": "^4.1.1", |
| 3317 | "sax": "^1.2.4" | 3311 | "sax": "^1.2.4" |
| ... | @@ -4339,12 +4333,6 @@ | ... | @@ -4339,12 +4333,6 @@ |
| 4339 | "which": "^2.0.1" | 4333 | "which": "^2.0.1" |
| 4340 | } | 4334 | } |
| 4341 | }, | 4335 | }, |
| 4342 | - "cross-unzip": { | ||
| 4343 | - "version": "0.0.2", | ||
| 4344 | - "resolved": "https://registry.npm.taobao.org/cross-unzip/download/cross-unzip-0.0.2.tgz", | ||
| 4345 | - "integrity": "sha1-UYO8R6CVWb78+YzEZXlkmZNZNy8=", | ||
| 4346 | - "dev": true | ||
| 4347 | - }, | ||
| 4348 | "crypto-browserify": { | 4336 | "crypto-browserify": { |
| 4349 | "version": "3.12.0", | 4337 | "version": "3.12.0", |
| 4350 | "resolved": "https://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz", | 4338 | "resolved": "https://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz", |
| ... | @@ -5024,22 +5012,24 @@ | ... | @@ -5024,22 +5012,24 @@ |
| 5024 | } | 5012 | } |
| 5025 | }, | 5013 | }, |
| 5026 | "electron-devtools-installer": { | 5014 | "electron-devtools-installer": { |
| 5027 | - "version": "2.2.4", | 5015 | + "version": "3.0.0", |
| 5028 | - "resolved": "https://registry.npm.taobao.org/electron-devtools-installer/download/electron-devtools-installer-2.2.4.tgz?cache=0&sync_timestamp=1586224685521&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-devtools-installer%2Fdownload%2Felectron-devtools-installer-2.2.4.tgz", | 5016 | + "resolved": "https://registry.npm.taobao.org/electron-devtools-installer/download/electron-devtools-installer-3.0.0.tgz?cache=0&sync_timestamp=1586224685521&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-devtools-installer%2Fdownload%2Felectron-devtools-installer-3.0.0.tgz", |
| 5029 | - "integrity": "sha1-JhpQM343Eh0zi5ZvB5IutJOah2M=", | 5017 | + "integrity": "sha1-tcQ5cIdG7Tb3sCIOGGV1Z7yiddg=", |
| 5030 | "dev": true, | 5018 | "dev": true, |
| 5031 | "requires": { | 5019 | "requires": { |
| 5032 | - "7zip": "0.0.6", | 5020 | + "rimraf": "^3.0.2", |
| 5033 | - "cross-unzip": "0.0.2", | 5021 | + "semver": "^7.2.1", |
| 5034 | - "rimraf": "^2.5.2", | 5022 | + "unzip-crx": "^0.2.0" |
| 5035 | - "semver": "^5.3.0" | ||
| 5036 | }, | 5023 | }, |
| 5037 | "dependencies": { | 5024 | "dependencies": { |
| 5038 | - "semver": { | 5025 | + "rimraf": { |
| 5039 | - "version": "5.7.1", | 5026 | + "version": "3.0.2", |
| 5040 | - "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1586534511518&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz", | 5027 | + "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1581229865753&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz", |
| 5041 | - "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=", | 5028 | + "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=", |
| 5042 | - "dev": true | 5029 | + "dev": true, |
| 5030 | + "requires": { | ||
| 5031 | + "glob": "^7.1.3" | ||
| 5032 | + } | ||
| 5043 | } | 5033 | } |
| 5044 | } | 5034 | } |
| 5045 | }, | 5035 | }, |
| ... | @@ -5157,30 +5147,17 @@ | ... | @@ -5157,30 +5147,17 @@ |
| 5157 | "dev": true | 5147 | "dev": true |
| 5158 | }, | 5148 | }, |
| 5159 | "electron-updater": { | 5149 | "electron-updater": { |
| 5160 | - "version": "4.2.5", | 5150 | + "version": "4.3.1", |
| 5161 | - "resolved": "https://registry.npm.taobao.org/electron-updater/download/electron-updater-4.2.5.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-updater%2Fdownload%2Felectron-updater-4.2.5.tgz", | 5151 | + "resolved": "https://registry.npm.taobao.org/electron-updater/download/electron-updater-4.3.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-updater%2Fdownload%2Felectron-updater-4.3.1.tgz", |
| 5162 | - "integrity": "sha1-287Y2m+Mb8LcZi8ndhMfWknOAY0=", | 5152 | + "integrity": "sha1-nUhbYmK8Vvz37mKx3Bs7EFo+lqc=", |
| 5163 | "requires": { | 5153 | "requires": { |
| 5164 | "@types/semver": "^7.1.0", | 5154 | "@types/semver": "^7.1.0", |
| 5165 | - "builder-util-runtime": "8.6.2", | 5155 | + "builder-util-runtime": "8.7.0", |
| 5166 | - "fs-extra": "^8.1.0", | 5156 | + "fs-extra": "^9.0.0", |
| 5167 | "js-yaml": "^3.13.1", | 5157 | "js-yaml": "^3.13.1", |
| 5168 | "lazy-val": "^1.0.4", | 5158 | "lazy-val": "^1.0.4", |
| 5169 | "lodash.isequal": "^4.5.0", | 5159 | "lodash.isequal": "^4.5.0", |
| 5170 | - "pako": "^1.0.11", | ||
| 5171 | "semver": "^7.1.3" | 5160 | "semver": "^7.1.3" |
| 5172 | - }, | ||
| 5173 | - "dependencies": { | ||
| 5174 | - "fs-extra": { | ||
| 5175 | - "version": "8.1.0", | ||
| 5176 | - "resolved": "https://registry.npm.taobao.org/fs-extra/download/fs-extra-8.1.0.tgz", | ||
| 5177 | - "integrity": "sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=", | ||
| 5178 | - "requires": { | ||
| 5179 | - "graceful-fs": "^4.2.0", | ||
| 5180 | - "jsonfile": "^4.0.0", | ||
| 5181 | - "universalify": "^0.1.0" | ||
| 5182 | - } | ||
| 5183 | - } | ||
| 5184 | } | 5161 | } |
| 5185 | }, | 5162 | }, |
| 5186 | "element-ui": { | 5163 | "element-ui": { |
| ... | @@ -7677,7 +7654,7 @@ | ... | @@ -7677,7 +7654,7 @@ |
| 7677 | }, | 7654 | }, |
| 7678 | "semver": { | 7655 | "semver": { |
| 7679 | "version": "5.7.1", | 7656 | "version": "5.7.1", |
| 7680 | - "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1586534511518&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz", | 7657 | + "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz", |
| 7681 | "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=", | 7658 | "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=", |
| 7682 | "dev": true | 7659 | "dev": true |
| 7683 | } | 7660 | } |
| ... | @@ -8864,6 +8841,7 @@ | ... | @@ -8864,6 +8841,7 @@ |
| 8864 | "version": "4.0.0", | 8841 | "version": "4.0.0", |
| 8865 | "resolved": "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz", | 8842 | "resolved": "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz", |
| 8866 | "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", | 8843 | "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", |
| 8844 | + "dev": true, | ||
| 8867 | "requires": { | 8845 | "requires": { |
| 8868 | "graceful-fs": "^4.1.6" | 8846 | "graceful-fs": "^4.1.6" |
| 8869 | } | 8847 | } |
| ... | @@ -8880,6 +8858,29 @@ | ... | @@ -8880,6 +8858,29 @@ |
| 8880 | "verror": "1.10.0" | 8858 | "verror": "1.10.0" |
| 8881 | } | 8859 | } |
| 8882 | }, | 8860 | }, |
| 8861 | + "jszip": { | ||
| 8862 | + "version": "3.4.0", | ||
| 8863 | + "resolved": "https://registry.npm.taobao.org/jszip/download/jszip-3.4.0.tgz?cache=0&sync_timestamp=1587341448981&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjszip%2Fdownload%2Fjszip-3.4.0.tgz", | ||
| 8864 | + "integrity": "sha1-GmlCH6Xwu5vCIqRryogYL7oHU1A=", | ||
| 8865 | + "dev": true, | ||
| 8866 | + "requires": { | ||
| 8867 | + "lie": "~3.3.0", | ||
| 8868 | + "pako": "~1.0.2", | ||
| 8869 | + "readable-stream": "~2.3.6", | ||
| 8870 | + "set-immediate-shim": "~1.0.1" | ||
| 8871 | + }, | ||
| 8872 | + "dependencies": { | ||
| 8873 | + "lie": { | ||
| 8874 | + "version": "3.3.0", | ||
| 8875 | + "resolved": "https://registry.npm.taobao.org/lie/download/lie-3.3.0.tgz", | ||
| 8876 | + "integrity": "sha1-3Pgt7lRfRgdNryAMfBxaCOD0D2o=", | ||
| 8877 | + "dev": true, | ||
| 8878 | + "requires": { | ||
| 8879 | + "immediate": "~3.0.5" | ||
| 8880 | + } | ||
| 8881 | + } | ||
| 8882 | + } | ||
| 8883 | + }, | ||
| 8883 | "keyv": { | 8884 | "keyv": { |
| 8884 | "version": "3.1.0", | 8885 | "version": "3.1.0", |
| 8885 | "resolved": "https://registry.npm.taobao.org/keyv/download/keyv-3.1.0.tgz", | 8886 | "resolved": "https://registry.npm.taobao.org/keyv/download/keyv-3.1.0.tgz", |
| ... | @@ -10710,7 +10711,8 @@ | ... | @@ -10710,7 +10711,8 @@ |
| 10710 | "pako": { | 10711 | "pako": { |
| 10711 | "version": "1.0.11", | 10712 | "version": "1.0.11", |
| 10712 | "resolved": "https://registry.npm.taobao.org/pako/download/pako-1.0.11.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpako%2Fdownload%2Fpako-1.0.11.tgz", | 10713 | "resolved": "https://registry.npm.taobao.org/pako/download/pako-1.0.11.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpako%2Fdownload%2Fpako-1.0.11.tgz", |
| 10713 | - "integrity": "sha1-bJWZ00DVTf05RjgCUqNXBaa5kr8=" | 10714 | + "integrity": "sha1-bJWZ00DVTf05RjgCUqNXBaa5kr8=", |
| 10715 | + "dev": true | ||
| 10714 | }, | 10716 | }, |
| 10715 | "parallel-transform": { | 10717 | "parallel-transform": { |
| 10716 | "version": "1.2.0", | 10718 | "version": "1.2.0", |
| ... | @@ -10978,9 +10980,9 @@ | ... | @@ -10978,9 +10980,9 @@ |
| 10978 | } | 10980 | } |
| 10979 | }, | 10981 | }, |
| 10980 | "portfinder": { | 10982 | "portfinder": { |
| 10981 | - "version": "1.0.25", | 10983 | + "version": "1.0.26", |
| 10982 | - "resolved": "https://registry.npm.taobao.org/portfinder/download/portfinder-1.0.25.tgz", | 10984 | + "resolved": "https://registry.npm.taobao.org/portfinder/download/portfinder-1.0.26.tgz", |
| 10983 | - "integrity": "sha1-JU/TN/+6hp9LnTftwpgFnLTTXso=", | 10985 | + "integrity": "sha1-R1ZY1WyjC+1yrH8TeO01C9G2TnA=", |
| 10984 | "dev": true, | 10986 | "dev": true, |
| 10985 | "requires": { | 10987 | "requires": { |
| 10986 | "async": "^2.6.2", | 10988 | "async": "^2.6.2", |
| ... | @@ -11139,7 +11141,7 @@ | ... | @@ -11139,7 +11141,7 @@ |
| 11139 | }, | 11141 | }, |
| 11140 | "posthtml": { | 11142 | "posthtml": { |
| 11141 | "version": "0.9.2", | 11143 | "version": "0.9.2", |
| 11142 | - "resolved": "https://registry.npm.taobao.org/posthtml/download/posthtml-0.9.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fposthtml%2Fdownload%2Fposthtml-0.9.2.tgz", | 11144 | + "resolved": "https://registry.npm.taobao.org/posthtml/download/posthtml-0.9.2.tgz", |
| 11143 | "integrity": "sha1-9MBtufZ7Yf0XxOJW5+PZUVv3Jv0=", | 11145 | "integrity": "sha1-9MBtufZ7Yf0XxOJW5+PZUVv3Jv0=", |
| 11144 | "dev": true, | 11146 | "dev": true, |
| 11145 | "requires": { | 11147 | "requires": { |
| ... | @@ -12536,6 +12538,12 @@ | ... | @@ -12536,6 +12538,12 @@ |
| 12536 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", | 12538 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", |
| 12537 | "dev": true | 12539 | "dev": true |
| 12538 | }, | 12540 | }, |
| 12541 | + "set-immediate-shim": { | ||
| 12542 | + "version": "1.0.1", | ||
| 12543 | + "resolved": "https://registry.npm.taobao.org/set-immediate-shim/download/set-immediate-shim-1.0.1.tgz", | ||
| 12544 | + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", | ||
| 12545 | + "dev": true | ||
| 12546 | + }, | ||
| 12539 | "set-value": { | 12547 | "set-value": { |
| 12540 | "version": "2.0.1", | 12548 | "version": "2.0.1", |
| 12541 | "resolved": "https://registry.npm.taobao.org/set-value/download/set-value-2.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fset-value%2Fdownload%2Fset-value-2.0.1.tgz", | 12549 | "resolved": "https://registry.npm.taobao.org/set-value/download/set-value-2.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fset-value%2Fdownload%2Fset-value-2.0.1.tgz", |
| ... | @@ -13314,9 +13322,9 @@ | ... | @@ -13314,9 +13322,9 @@ |
| 13314 | "dev": true | 13322 | "dev": true |
| 13315 | }, | 13323 | }, |
| 13316 | "style-loader": { | 13324 | "style-loader": { |
| 13317 | - "version": "1.2.0", | 13325 | + "version": "1.2.1", |
| 13318 | - "resolved": "https://registry.npm.taobao.org/style-loader/download/style-loader-1.2.0.tgz?cache=0&sync_timestamp=1587731556074&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstyle-loader%2Fdownload%2Fstyle-loader-1.2.0.tgz", | 13326 | + "resolved": "https://registry.npm.taobao.org/style-loader/download/style-loader-1.2.1.tgz", |
| 13319 | - "integrity": "sha1-945NScr1AY98A64YhuEnAST+6wo=", | 13327 | + "integrity": "sha1-xcu/vxFw0HbP3YbgEJxbuhFLqho=", |
| 13320 | "dev": true, | 13328 | "dev": true, |
| 13321 | "requires": { | 13329 | "requires": { |
| 13322 | "loader-utils": "^2.0.0", | 13330 | "loader-utils": "^2.0.0", |
| ... | @@ -13526,9 +13534,9 @@ | ... | @@ -13526,9 +13534,9 @@ |
| 13526 | } | 13534 | } |
| 13527 | }, | 13535 | }, |
| 13528 | "svg-baker-runtime": { | 13536 | "svg-baker-runtime": { |
| 13529 | - "version": "1.4.6", | 13537 | + "version": "1.4.7", |
| 13530 | - "resolved": "https://registry.npm.taobao.org/svg-baker-runtime/download/svg-baker-runtime-1.4.6.tgz", | 13538 | + "resolved": "https://registry.npm.taobao.org/svg-baker-runtime/download/svg-baker-runtime-1.4.7.tgz?cache=0&sync_timestamp=1588076122804&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsvg-baker-runtime%2Fdownload%2Fsvg-baker-runtime-1.4.7.tgz", |
| 13531 | - "integrity": "sha1-c0mXNsY2YQEhqeF65s6y6hAj7Gs=", | 13539 | + "integrity": "sha1-9HIGN/W2IC7vY3jYHx/q0IFfik4=", |
| 13532 | "dev": true, | 13540 | "dev": true, |
| 13533 | "requires": { | 13541 | "requires": { |
| 13534 | "deepmerge": "1.3.2", | 13542 | "deepmerge": "1.3.2", |
| ... | @@ -13545,9 +13553,9 @@ | ... | @@ -13545,9 +13553,9 @@ |
| 13545 | } | 13553 | } |
| 13546 | }, | 13554 | }, |
| 13547 | "svg-sprite-loader": { | 13555 | "svg-sprite-loader": { |
| 13548 | - "version": "4.2.6", | 13556 | + "version": "4.2.7", |
| 13549 | - "resolved": "https://registry.npm.taobao.org/svg-sprite-loader/download/svg-sprite-loader-4.2.6.tgz?cache=0&sync_timestamp=1587916768179&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsvg-sprite-loader%2Fdownload%2Fsvg-sprite-loader-4.2.6.tgz", | 13557 | + "resolved": "https://registry.npm.taobao.org/svg-sprite-loader/download/svg-sprite-loader-4.2.7.tgz?cache=0&sync_timestamp=1588076872686&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsvg-sprite-loader%2Fdownload%2Fsvg-sprite-loader-4.2.7.tgz", |
| 13550 | - "integrity": "sha1-n1rG1114voB1iWarxCEKKF7bIHM=", | 13558 | + "integrity": "sha1-IwQwm0Y2ijTnsnFpNmTZJ2HYuU4=", |
| 13551 | "dev": true, | 13559 | "dev": true, |
| 13552 | "requires": { | 13560 | "requires": { |
| 13553 | "bluebird": "^3.5.0", | 13561 | "bluebird": "^3.5.0", |
| ... | @@ -13557,7 +13565,7 @@ | ... | @@ -13557,7 +13565,7 @@ |
| 13557 | "html-webpack-plugin": "^3.2.0", | 13565 | "html-webpack-plugin": "^3.2.0", |
| 13558 | "loader-utils": "^1.1.0", | 13566 | "loader-utils": "^1.1.0", |
| 13559 | "svg-baker": "^1.5.0", | 13567 | "svg-baker": "^1.5.0", |
| 13560 | - "svg-baker-runtime": "^1.4.6", | 13568 | + "svg-baker-runtime": "^1.4.7", |
| 13561 | "url-slug": "2.0.0" | 13569 | "url-slug": "2.0.0" |
| 13562 | }, | 13570 | }, |
| 13563 | "dependencies": { | 13571 | "dependencies": { |
| ... | @@ -14284,7 +14292,8 @@ | ... | @@ -14284,7 +14292,8 @@ |
| 14284 | "universalify": { | 14292 | "universalify": { |
| 14285 | "version": "0.1.2", | 14293 | "version": "0.1.2", |
| 14286 | "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz?cache=0&sync_timestamp=1583530825899&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funiversalify%2Fdownload%2Funiversalify-0.1.2.tgz", | 14294 | "resolved": "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz?cache=0&sync_timestamp=1583530825899&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funiversalify%2Fdownload%2Funiversalify-0.1.2.tgz", |
| 14287 | - "integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=" | 14295 | + "integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=", |
| 14296 | + "dev": true | ||
| 14288 | }, | 14297 | }, |
| 14289 | "unpipe": { | 14298 | "unpipe": { |
| 14290 | "version": "1.0.0", | 14299 | "version": "1.0.0", |
| ... | @@ -14331,6 +14340,17 @@ | ... | @@ -14331,6 +14340,17 @@ |
| 14331 | } | 14340 | } |
| 14332 | } | 14341 | } |
| 14333 | }, | 14342 | }, |
| 14343 | + "unzip-crx": { | ||
| 14344 | + "version": "0.2.0", | ||
| 14345 | + "resolved": "https://registry.npm.taobao.org/unzip-crx/download/unzip-crx-0.2.0.tgz", | ||
| 14346 | + "integrity": "sha1-TAuqi9rHViVnVL7KeEPBPXuFjBg=", | ||
| 14347 | + "dev": true, | ||
| 14348 | + "requires": { | ||
| 14349 | + "jszip": "^3.1.0", | ||
| 14350 | + "mkdirp": "^0.5.1", | ||
| 14351 | + "yaku": "^0.16.6" | ||
| 14352 | + } | ||
| 14353 | + }, | ||
| 14334 | "upath": { | 14354 | "upath": { |
| 14335 | "version": "1.2.0", | 14355 | "version": "1.2.0", |
| 14336 | "resolved": "https://registry.npm.taobao.org/upath/download/upath-1.2.0.tgz?cache=0&sync_timestamp=1567457281208&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fupath%2Fdownload%2Fupath-1.2.0.tgz", | 14356 | "resolved": "https://registry.npm.taobao.org/upath/download/upath-1.2.0.tgz?cache=0&sync_timestamp=1567457281208&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fupath%2Fdownload%2Fupath-1.2.0.tgz", |
| ... | @@ -15955,6 +15975,12 @@ | ... | @@ -15955,6 +15975,12 @@ |
| 15955 | "integrity": "sha1-le+U+F7MgdAHwmThkKEg8KPIVms=", | 15975 | "integrity": "sha1-le+U+F7MgdAHwmThkKEg8KPIVms=", |
| 15956 | "dev": true | 15976 | "dev": true |
| 15957 | }, | 15977 | }, |
| 15978 | + "yaku": { | ||
| 15979 | + "version": "0.16.7", | ||
| 15980 | + "resolved": "https://registry.npm.taobao.org/yaku/download/yaku-0.16.7.tgz", | ||
| 15981 | + "integrity": "sha1-HRlceKqbW/hHnIlblQT9TwhHmE4=", | ||
| 15982 | + "dev": true | ||
| 15983 | + }, | ||
| 15958 | "yallist": { | 15984 | "yallist": { |
| 15959 | "version": "3.1.1", | 15985 | "version": "3.1.1", |
| 15960 | "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-3.1.1.tgz", | 15986 | "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-3.1.1.tgz", | ... | ... |
| ... | @@ -72,7 +72,7 @@ | ... | @@ -72,7 +72,7 @@ |
| 72 | "dependencies": { | 72 | "dependencies": { |
| 73 | "axios": "^0.19.2", | 73 | "axios": "^0.19.2", |
| 74 | "date-fns": "^2.12.0", | 74 | "date-fns": "^2.12.0", |
| 75 | - "electron-updater": "^4.2.5", | 75 | + "electron-updater": "^4.3.1", |
| 76 | "element-ui": "^2.13.1", | 76 | "element-ui": "^2.13.1", |
| 77 | "express": "^4.17.1", | 77 | "express": "^4.17.1", |
| 78 | "fs-extra": "^9.0.0", | 78 | "fs-extra": "^9.0.0", |
| ... | @@ -138,11 +138,11 @@ | ... | @@ -138,11 +138,11 @@ |
| 138 | "multispinner": "^0.2.1", | 138 | "multispinner": "^0.2.1", |
| 139 | "node-loader": "^0.6.0", | 139 | "node-loader": "^0.6.0", |
| 140 | "node-sass": "^4.14.0", | 140 | "node-sass": "^4.14.0", |
| 141 | - "portfinder": "^1.0.25", | 141 | + "portfinder": "^1.0.26", |
| 142 | "sass-loader": "^8.0.2", | 142 | "sass-loader": "^8.0.2", |
| 143 | "split2": "^3.1.1", | 143 | "split2": "^3.1.1", |
| 144 | - "style-loader": "^1.2.0", | 144 | + "style-loader": "^1.2.1", |
| 145 | - "svg-sprite-loader": "^4.2.6", | 145 | + "svg-sprite-loader": "^4.2.7", |
| 146 | "terser-webpack-plugin": "^2.3.6", | 146 | "terser-webpack-plugin": "^2.3.6", |
| 147 | "through2-filter": "^3.0.0", | 147 | "through2-filter": "^3.0.0", |
| 148 | "url-loader": "^4.1.0", | 148 | "url-loader": "^4.1.0", | ... | ... |
| ... | @@ -53,7 +53,6 @@ | ... | @@ -53,7 +53,6 @@ |
| 53 | 53 | ||
| 54 | <script> | 54 | <script> |
| 55 | import SystemInformation from "./LandingPage/SystemInformation"; | 55 | import SystemInformation from "./LandingPage/SystemInformation"; |
| 56 | -import ipcApi from "../utils/ipcRenderer"; | ||
| 57 | import { message } from "@/api/login"; | 56 | import { message } from "@/api/login"; |
| 58 | export default { | 57 | export default { |
| 59 | name: "landing-page", | 58 | name: "landing-page", |
| ... | @@ -90,8 +89,8 @@ export default { | ... | @@ -90,8 +89,8 @@ export default { |
| 90 | }); | 89 | }); |
| 91 | }, | 90 | }, |
| 92 | StartServer() { | 91 | StartServer() { |
| 93 | - ipcApi.send("statr-server"); | 92 | + this.$ipcApi.send("statr-server"); |
| 94 | - ipcApi.on("confirm-start", (event, arg) => { | 93 | + this.$ipcApi.on("confirm-start", (event, arg) => { |
| 95 | console.log(arg); | 94 | console.log(arg); |
| 96 | this.$message({ | 95 | this.$message({ |
| 97 | type: "success", | 96 | type: "success", |
| ... | @@ -130,8 +129,8 @@ export default { | ... | @@ -130,8 +129,8 @@ export default { |
| 130 | noLink: true, | 129 | noLink: true, |
| 131 | message: "此操作会清空本地数据库中的所有数据,是否继续?" | 130 | message: "此操作会清空本地数据库中的所有数据,是否继续?" |
| 132 | }; | 131 | }; |
| 133 | - ipcApi.send("open-messagebox", data); | 132 | + this.$ipcApi.send("open-messagebox", data); |
| 134 | - ipcApi.on("confirm-message", (event, arg) => { | 133 | + this.$ipcApi.on("confirm-message", (event, arg) => { |
| 135 | console.log(arg); | 134 | console.log(arg); |
| 136 | if (arg.response === 0) { | 135 | if (arg.response === 0) { |
| 137 | this.$db.deleall({ name: "yyy" }).then(res => { | 136 | this.$db.deleall({ name: "yyy" }).then(res => { |
| ... | @@ -147,7 +146,7 @@ export default { | ... | @@ -147,7 +146,7 @@ export default { |
| 147 | title: "错误", | 146 | title: "错误", |
| 148 | message: "已经没有数据可以被删除!" | 147 | message: "已经没有数据可以被删除!" |
| 149 | }; | 148 | }; |
| 150 | - ipcApi.send("open-errorbox", errormsg); | 149 | + this.$ipcApi.send("open-errorbox", errormsg); |
| 151 | } | 150 | } |
| 152 | }); | 151 | }); |
| 153 | } | 152 | } |
| ... | @@ -157,9 +156,9 @@ export default { | ... | @@ -157,9 +156,9 @@ export default { |
| 157 | switch (data) { | 156 | switch (data) { |
| 158 | case "one": | 157 | case "one": |
| 159 | const dialog = this.$electron.remote.dialog; | 158 | const dialog = this.$electron.remote.dialog; |
| 160 | - ipcApi.send("check-update"); | 159 | + this.$ipcApi.send("check-update"); |
| 161 | console.log("启动检查"); | 160 | console.log("启动检查"); |
| 162 | - ipcApi.on("UpdateMsg", (event, data) => { | 161 | + this.$ipcApi.on("UpdateMsg", (event, data) => { |
| 163 | console.log(data); | 162 | console.log(data); |
| 164 | switch (data.state) { | 163 | switch (data.state) { |
| 165 | case -1: | 164 | case -1: |
| ... | @@ -189,7 +188,7 @@ export default { | ... | @@ -189,7 +188,7 @@ export default { |
| 189 | this.$alert("更新下载完成!", "提示", { | 188 | this.$alert("更新下载完成!", "提示", { |
| 190 | confirmButtonText: "确定", | 189 | confirmButtonText: "确定", |
| 191 | callback: action => { | 190 | callback: action => { |
| 192 | - ipcApi.send("confirm-update"); | 191 | + this.$ipcApi.send("confirm-update"); |
| 193 | } | 192 | } |
| 194 | }); | 193 | }); |
| 195 | break; | 194 | break; |
| ... | @@ -201,34 +200,34 @@ export default { | ... | @@ -201,34 +200,34 @@ export default { |
| 201 | break; | 200 | break; |
| 202 | case "two": | 201 | case "two": |
| 203 | console.log(111); | 202 | console.log(111); |
| 204 | - ipcApi.send("start-download"); | 203 | + this.$ipcApi.send("start-download"); |
| 205 | - ipcApi.on("confirm-download", (event, arg) => { | 204 | + this.$ipcApi.on("confirm-download", (event, arg) => { |
| 206 | if (arg) { | 205 | if (arg) { |
| 207 | this.dialogVisible = true; | 206 | this.dialogVisible = true; |
| 208 | } | 207 | } |
| 209 | }); | 208 | }); |
| 210 | - ipcApi.on("download-progress", (event, arg) => { | 209 | + this.$ipcApi.on("download-progress", (event, arg) => { |
| 211 | this.percentage = Number(arg); | 210 | this.percentage = Number(arg); |
| 212 | }); | 211 | }); |
| 213 | - ipcApi.on("download-error", (event, arg) => { | 212 | + this.$ipcApi.on("download-error", (event, arg) => { |
| 214 | if (arg) { | 213 | if (arg) { |
| 215 | this.progressStaus = "exception"; | 214 | this.progressStaus = "exception"; |
| 216 | this.percentage = 40; | 215 | this.percentage = 40; |
| 217 | this.colors = "#d81e06"; | 216 | this.colors = "#d81e06"; |
| 218 | } | 217 | } |
| 219 | }); | 218 | }); |
| 220 | - ipcApi.on("download-paused", (event, arg) => { | 219 | + this.$ipcApi.on("download-paused", (event, arg) => { |
| 221 | if (arg) { | 220 | if (arg) { |
| 222 | this.progressStaus = "warning"; | 221 | this.progressStaus = "warning"; |
| 223 | this.$alert("下载由于未知原因被中断!", "提示", { | 222 | this.$alert("下载由于未知原因被中断!", "提示", { |
| 224 | confirmButtonText: "重试", | 223 | confirmButtonText: "重试", |
| 225 | callback: action => { | 224 | callback: action => { |
| 226 | - ipcApi.send("satrt-download"); | 225 | + this.$ipcApi.send("satrt-download"); |
| 227 | } | 226 | } |
| 228 | }); | 227 | }); |
| 229 | } | 228 | } |
| 230 | }); | 229 | }); |
| 231 | - ipcApi.on("download-done", (event, age) => { | 230 | + this.$ipcApi.on("download-done", (event, age) => { |
| 232 | this.filePath = age.filePath; | 231 | this.filePath = age.filePath; |
| 233 | this.progressStaus = "success"; | 232 | this.progressStaus = "success"; |
| 234 | this.$alert("更新下载完成!", "提示", { | 233 | this.$alert("更新下载完成!", "提示", { |
| ... | @@ -249,12 +248,12 @@ export default { | ... | @@ -249,12 +248,12 @@ export default { |
| 249 | } | 248 | } |
| 250 | }, | 249 | }, |
| 251 | destroyed() { | 250 | destroyed() { |
| 252 | - ipcApi.remove("confirm-message"); | 251 | + this.$ipcApi.remove("confirm-message"); |
| 253 | - ipcApi.remove("download-done"); | 252 | + this.$ipcApi.remove("download-done"); |
| 254 | - ipcApi.remove("download-paused"); | 253 | + this.$ipcApi.remove("download-paused"); |
| 255 | - ipcApi.remove("confirm-download"); | 254 | + this.$ipcApi.remove("confirm-download"); |
| 256 | - ipcApi.remove("download-progress"); | 255 | + this.$ipcApi.remove("download-progress"); |
| 257 | - ipcApi.remove("download-error"); | 256 | + this.$ipcApi.remove("download-error"); |
| 258 | } | 257 | } |
| 259 | }; | 258 | }; |
| 260 | </script> | 259 | </script> | ... | ... |
| ... | @@ -35,49 +35,51 @@ | ... | @@ -35,49 +35,51 @@ |
| 35 | </template> | 35 | </template> |
| 36 | 36 | ||
| 37 | <script> | 37 | <script> |
| 38 | - export default { | 38 | +export default { |
| 39 | - data () { | 39 | + data() { |
| 40 | - return { | 40 | + return { |
| 41 | - electron: process.versions.electron, | 41 | + electron: process.versions.electron || "浏览器环境", |
| 42 | - name: this.$route.name, | 42 | + name: this.$route.name, |
| 43 | - node: process.versions.node, | 43 | + node: process.versions.node || "浏览器环境", |
| 44 | - path: this.$route.path, | 44 | + path: this.$route.path, |
| 45 | - platform: require('os').platform(), | 45 | + platform: require("os").platform(), |
| 46 | - arch:require('os').arch(), | 46 | + arch: require("os").arch(), |
| 47 | - vue: require('vue/package.json').version | 47 | + vue: require("vue/package.json").version |
| 48 | - } | 48 | + }; |
| 49 | - }, | 49 | + }, |
| 50 | - mounted(){ | 50 | + mounted() { |
| 51 | - console.log(this.$route) | 51 | + console.log(this.$route); |
| 52 | - } | ||
| 53 | } | 52 | } |
| 53 | +}; | ||
| 54 | </script> | 54 | </script> |
| 55 | 55 | ||
| 56 | <style scoped> | 56 | <style scoped> |
| 57 | - .title { | 57 | +.title { |
| 58 | - color: #888; | 58 | + color: #888; |
| 59 | - font-size: 18px; | 59 | + font-size: 18px; |
| 60 | - font-weight: initial; | 60 | + font-weight: initial; |
| 61 | - letter-spacing: .25px; | 61 | + letter-spacing: 0.25px; |
| 62 | - margin-top: 10px; | 62 | + margin-top: 10px; |
| 63 | - } | 63 | +} |
| 64 | 64 | ||
| 65 | - .items { margin-top: 8px; } | 65 | +.items { |
| 66 | + margin-top: 8px; | ||
| 67 | +} | ||
| 66 | 68 | ||
| 67 | - .item { | 69 | +.item { |
| 68 | - display: flex; | 70 | + display: flex; |
| 69 | - align-items: center; | 71 | + align-items: center; |
| 70 | - margin-bottom: 6px; | 72 | + margin-bottom: 6px; |
| 71 | - line-height: 24px; | 73 | + line-height: 24px; |
| 72 | - } | 74 | +} |
| 73 | 75 | ||
| 74 | - .item .name { | 76 | +.item .name { |
| 75 | - color: #6a6a6a; | 77 | + color: #6a6a6a; |
| 76 | - margin-right: 6px; | 78 | + margin-right: 6px; |
| 77 | - } | 79 | +} |
| 78 | 80 | ||
| 79 | - .item .value { | 81 | +.item .value { |
| 80 | - color: #35495e; | 82 | + color: #35495e; |
| 81 | - font-weight: bold; | 83 | + font-weight: bold; |
| 82 | - } | 84 | +} |
| 83 | </style> | 85 | </style> | ... | ... |
| 1 | <!-- --> | 1 | <!-- --> |
| 2 | <template> | 2 | <template> |
| 3 | - <div class="window-title" v-if="!IsUseSysTitle&&isMac"> | 3 | + <div class="window-title" v-if="!IsUseSysTitle&&isMac&&!IsWeb"> |
| 4 | <!-- 软件logo预留位置 --> | 4 | <!-- 软件logo预留位置 --> |
| 5 | <div style="-webkit-app-region: drag;" class="logo"> | 5 | <div style="-webkit-app-region: drag;" class="logo"> |
| 6 | <svg-icon icon-class="electron-logo"></svg-icon> | 6 | <svg-icon icon-class="electron-logo"></svg-icon> |
| ... | @@ -25,32 +25,35 @@ | ... | @@ -25,32 +25,35 @@ |
| 25 | </template> | 25 | </template> |
| 26 | 26 | ||
| 27 | <script> | 27 | <script> |
| 28 | -import ipcApi from "@/utils/ipcRenderer"; | ||
| 29 | export default { | 28 | export default { |
| 30 | data: () => ({ | 29 | data: () => ({ |
| 31 | mix: false, | 30 | mix: false, |
| 32 | IsUseSysTitle: false, | 31 | IsUseSysTitle: false, |
| 33 | - isMac:process.platform !== 'darwin' | 32 | + isMac: process.platform !== "darwin", |
| 33 | + IsWeb: process.env.IS_WEB | ||
| 34 | }), | 34 | }), |
| 35 | 35 | ||
| 36 | components: {}, | 36 | components: {}, |
| 37 | created() { | 37 | created() { |
| 38 | - ipcApi.send("IsUseSysTitle"); | 38 | + this.$ipcApi.send("IsUseSysTitle"); |
| 39 | - ipcApi.on("CisUseSysTitle", (event, arg) => (this.IsUseSysTitle = arg)); | 39 | + this.$ipcApi.on( |
| 40 | + "CisUseSysTitle", | ||
| 41 | + (event, arg) => (this.IsUseSysTitle = arg) | ||
| 42 | + ); | ||
| 40 | }, | 43 | }, |
| 41 | 44 | ||
| 42 | mounted() {}, | 45 | mounted() {}, |
| 43 | 46 | ||
| 44 | methods: { | 47 | methods: { |
| 45 | Mini() { | 48 | Mini() { |
| 46 | - ipcApi.send("windows-mini"); | 49 | + this.$ipcApi.send("windows-mini"); |
| 47 | }, | 50 | }, |
| 48 | MixOrReduction() { | 51 | MixOrReduction() { |
| 49 | - ipcApi.send("window-max"); | 52 | + this.$ipcApi.send("window-max"); |
| 50 | - ipcApi.on("window-confirm", (event, arg) => (this.mix = arg)); | 53 | + this.$ipcApi.on("window-confirm", (event, arg) => (this.mix = arg)); |
| 51 | }, | 54 | }, |
| 52 | Close() { | 55 | Close() { |
| 53 | - ipcApi.send("window-close"); | 56 | + this.$ipcApi.send("window-close"); |
| 54 | } | 57 | } |
| 55 | } | 58 | } |
| 56 | }; | 59 | }; |
| ... | @@ -69,7 +72,7 @@ export default { | ... | @@ -69,7 +72,7 @@ export default { |
| 69 | .title { | 72 | .title { |
| 70 | text-align: center; | 73 | text-align: center; |
| 71 | } | 74 | } |
| 72 | - .logo{ | 75 | + .logo { |
| 73 | margin-left: 20px; | 76 | margin-left: 20px; |
| 74 | } | 77 | } |
| 75 | .controls-container { | 78 | .controls-container { | ... | ... |
| ... | @@ -3,8 +3,6 @@ import Vue from 'vue' | ... | @@ -3,8 +3,6 @@ import Vue from 'vue' |
| 3 | import App from './App' | 3 | import App from './App' |
| 4 | import router from './router' | 4 | import router from './router' |
| 5 | import store from './store' | 5 | import store from './store' |
| 6 | -// 导入数据操作库 | ||
| 7 | -import db from './api/operationalData' | ||
| 8 | // 引用element | 6 | // 引用element |
| 9 | import ElementUI from 'element-ui' | 7 | import ElementUI from 'element-ui' |
| 10 | import 'element-ui/lib/theme-chalk/index.css' | 8 | import 'element-ui/lib/theme-chalk/index.css' |
| ... | @@ -14,14 +12,18 @@ import './error' | ... | @@ -14,14 +12,18 @@ import './error' |
| 14 | import './icons' | 12 | import './icons' |
| 15 | import '@/styles/index.scss' | 13 | import '@/styles/index.scss' |
| 16 | 14 | ||
| 17 | -if (!require('../../config').IsUseSysTitle) require('@/styles/custom-title.scss') | 15 | +if (!process.env.IS_WEB) { |
| 18 | - | 16 | + Vue.use(require('vue-electron')) |
| 19 | -if (!process.env.IS_WEB) Vue.use(require('vue-electron')) | 17 | + if (!require('../../config').IsUseSysTitle) { |
| 18 | + require('@/styles/custom-title.scss') | ||
| 19 | + } | ||
| 20 | + // 当处于electron状态下才引用db | ||
| 21 | + Vue.prototype.$db = require('./api/operationalData').default | ||
| 22 | + Vue.prototype.$ipcApi = require('./utils/ipcRenderer').default | ||
| 23 | +} | ||
| 20 | 24 | ||
| 21 | Vue.use(ElementUI) | 25 | Vue.use(ElementUI) |
| 22 | 26 | ||
| 23 | -Vue.prototype.$db = db | ||
| 24 | - | ||
| 25 | Vue.config.productionTip = false | 27 | Vue.config.productionTip = false |
| 26 | /* eslint-disable no-new */ | 28 | /* eslint-disable no-new */ |
| 27 | const vue = new Vue({ | 29 | const vue = new Vue({ | ... | ... |
-
请 注册 或 登录 后发表评论