diff --git a/.env.example b/.env.example index bd591ef..fb667ec 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ -VUE_APP_NETEASE_API_URL=http://127.0.0.1:3000 +VUE_APP_NETEASE_API_URL=/api VUE_APP_ELECTRON_API_URL=/api VUE_APP_ELECTRON_API_URL_DEV=http://127.0.0.1:3000 VUE_APP_ENABLE_SENTRY=false -DEV_SERVER_PORT=20201 \ No newline at end of file +DEV_SERVER_PORT=20201 diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 77cc6a7..06a6a0a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - os: [macos-latest, windows-latest] + os: [macos-latest, windows-latest, ubuntu-latest] steps: - name: Check out Git repository @@ -17,10 +17,17 @@ jobs: - name: Install Node.js, NPM and Yarn uses: actions/setup-node@v1 with: - node-version: 12.16.3 + node-version: 14.16.0 + + - name: Install RPM & Pacman (only on Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update && + sudo apt-get install --no-install-recommends -y rpm && + sudo apt-get install --no-install-recommends -y bsdtar - name: Build/release Electron app - uses: samuelmeuli/action-electron-builder@v1 + uses: samuelmeuli/action-electron-builder@v1.6.0 with: # GitHub token, automatically provided to the action # (No need to define this secret in the repo settings) @@ -35,11 +42,17 @@ jobs: - uses: actions/upload-artifact@v2 with: name: YesPlayMusic-mac - path: dist_electron/*.dmg + path: dist_electron/*-universal.dmg if-no-files-found: ignore - uses: actions/upload-artifact@v2 with: name: YesPlayMusic-win - path: dist_electron/*.exe + path: dist_electron/*Setup*.exe + if-no-files-found: ignore + + - uses: actions/upload-artifact@v2 + with: + name: YesPlayMusic-linux + path: dist_electron/*.AppImage if-no-files-found: ignore diff --git a/package.json b/package.json index 736073c..2f7e78c 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "core-js": "^3.6.5", "crypto-js": "^4.0.0", "dayjs": "^1.8.36", - "electron": "11.0.2", + "electron": "^12.0.0", + "electron-builder": "^22.10.5", "electron-context-menu": "^2.3.0", "electron-debug": "^3.1.0", "electron-devtools-installer": "^3.1.1", @@ -60,7 +61,6 @@ "vscode-codicons": "^0.0.14", "vue": "^2.6.11", "vue-analytics": "^5.22.1", - "vue-electron": "^1.0.6", "vue-i18n": "^8.22.0", "vue-router": "^3.4.3", "vue-slider-component": "^3.2.5", @@ -76,7 +76,6 @@ "@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-service": "~4.5.0", "babel-eslint": "^10.1.0", - "electron-builder": "^22.10.5", "eslint": "^6.7.2", "eslint-plugin-vue": "^6.2.2", "husky": "^4.3.0", diff --git a/public/img/icons/exit.png b/public/img/icons/exit.png new file mode 100644 index 0000000..01e21b2 Binary files /dev/null and b/public/img/icons/exit.png differ diff --git a/public/img/icons/left.png b/public/img/icons/left.png new file mode 100644 index 0000000..9e49d7e Binary files /dev/null and b/public/img/icons/left.png differ diff --git a/public/img/icons/like.png b/public/img/icons/like.png new file mode 100644 index 0000000..4bea102 Binary files /dev/null and b/public/img/icons/like.png differ diff --git a/public/img/icons/play.png b/public/img/icons/play.png new file mode 100644 index 0000000..90537c8 Binary files /dev/null and b/public/img/icons/play.png differ diff --git a/public/img/icons/repeat.png b/public/img/icons/repeat.png new file mode 100644 index 0000000..d4c3fc7 Binary files /dev/null and b/public/img/icons/repeat.png differ diff --git a/public/img/icons/right.png b/public/img/icons/right.png new file mode 100644 index 0000000..50c2e75 Binary files /dev/null and b/public/img/icons/right.png differ diff --git a/src/background.js b/src/background.js index fa7c55c..5d2a7c0 100644 --- a/src/background.js +++ b/src/background.js @@ -12,6 +12,7 @@ import installExtension, { VUEJS_DEVTOOLS } from "electron-devtools-installer"; import express from "express"; import expressProxy from "express-http-proxy"; import Store from "electron-store"; +import path from "path"; class Background { constructor() { @@ -88,20 +89,18 @@ class Background { createWindow() { console.log("creating app window"); - // Only for Windows, a special title bar for it - const withoutFrame = process.platform == "win32"; - this.window = new BrowserWindow({ width: this.store.get("window.width") | 1440, height: this.store.get("window.height") | 840, minWidth: 1080, minHeight: 720, titleBarStyle: "hiddenInset", - frame: !withoutFrame, + frame: process.platform !== "win32", webPreferences: { webSecurity: false, nodeIntegration: true, enableRemoteModule: true, + contextIsolation: false, }, }); diff --git a/src/components/FMCard.vue b/src/components/FMCard.vue index 96fb717..a6ef73b 100644 --- a/src/components/FMCard.vue +++ b/src/components/FMCard.vue @@ -8,7 +8,7 @@