From bc0de620c12b55155b5d60fa3a8766437d79dac5 Mon Sep 17 00:00:00 2001 From: qier222 Date: Mon, 23 Nov 2020 16:04:45 +0800 Subject: [PATCH] refactor: organize codes --- package.json | 18 ++- src/App.vue | 51 +----- src/background.js | 91 +++++------ src/components/Navbar.vue | 1 + src/components/Player.vue | 4 +- src/electron/bounced.js | 6 - src/electron/dockMenu.js | 25 +++ src/electron/ipcMain.js | 19 +++ src/electron/ipcRenderer.js | 49 ++++++ src/electron/menu.js | 9 +- src/electron/preload.js | 0 src/electron/services.js | 91 +++++------ src/electron/setIcon.js | 3 - src/electron/tray.js | 43 +++--- src/store/actions.js | 2 +- src/store/index.js | 11 +- src/store/plugins/broadcast.js | 25 +-- src/store/plugins/localStorage.js | 2 +- src/utils/auth.js | 14 +- src/utils/db.js | 2 +- src/views/loginAccount.vue | 6 +- vue.config.js | 93 +++++------ yarn.lock | 248 +++++++++++++++--------------- 23 files changed, 415 insertions(+), 398 deletions(-) delete mode 100644 src/electron/bounced.js create mode 100644 src/electron/dockMenu.js create mode 100644 src/electron/ipcMain.js create mode 100644 src/electron/ipcRenderer.js delete mode 100644 src/electron/preload.js delete mode 100644 src/electron/setIcon.js diff --git a/package.json b/package.json index 4ff9e94..71629da 100644 --- a/package.json +++ b/package.json @@ -9,26 +9,28 @@ "build": "vue-cli-service build", "lint": "vue-cli-service lint", "electron:build": "vue-cli-service electron:build -mwl -p never", + "electron:build-mac": "vue-cli-service electron:build -m -p never", + "electron:build-win": "vue-cli-service electron:build -w -p never", + "electron:build-linux": "vue-cli-service electron:build -l -p never", "electron:serve": "vue-cli-service electron:serve", - "electron:buildicon": "electron-icon-builder --input=./public/img/icons/android-chrome-512x512.png --output=build --flatten", - "electron:publish": "vue-cli-service electron:build -p always", + "electron:buildicon": "electron-icon-builder --input=./build/icons/icon.png --output=build --flatten", + "electron:publish": "vue-cli-service electron:build -mwl -p always", "postinstall": "electron-builder install-app-deps", "postuninstall": "electron-builder install-app-deps", "prettier": "npx prettier --write ./src ./script", - "napi:run": "cd ./napi && npm run start", - "napi:pull": "node script/pull.js", - "napi:install": "cd ./napi && npm install", - "napi:setup": "npm run napi:pull && npm run napi:install" + "netease_api:run": "cd ./netease_api && npm run start", + "netease_api:pull": "node script/pull.js", + "netease_api:install": "cd ./netease_api && npm install", + "netease_api:setup": "npm run netease_api:pull && npm run netease_api:install" }, "main": "background.js", "dependencies": { - "apicache": "^1.5.3", "axios": "^0.21.0", "big-integer": "^1.6.48", "core-js": "^3.6.5", "crypto-js": "^4.0.0", "dayjs": "^1.8.36", - "electron": "^10.1.4", + "electron": "11.0.2", "electron-context-menu": "^2.3.0", "electron-debug": "^3.1.0", "electron-devtools-installer": "^3.1.1", diff --git a/src/App.vue b/src/App.vue index c1fa3f8..40e7970 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,6 @@