From f4383ba848ba22f07792c79dfd11af0279c7af03 Mon Sep 17 00:00:00 2001 From: imsyy Date: Fri, 12 Jan 2024 11:08:35 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=92=AD=E6=94=BE=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=94=AF=E6=8C=81=E8=B0=83=E8=8A=82=E9=9F=B3=E9=87=8F?= =?UTF-8?q?=20#124?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/add.yml | 17 --- .github/ISSUE_TEMPLATE/bug.yml | 4 +- .github/ISSUE_TEMPLATE/config.yml | 3 + electron.vite.config.mjs | 2 +- electron/main/index.js | 4 +- electron/main/startNcmServer.js | 2 +- electron/preload/{index.js => index.mjs} | 0 package.json | 5 +- pnpm-lock.yaml | 158 +++++++++++------------ src/components/Modal/LoginPhone.vue | 57 ++++---- src/components/Player/PlayerControl.vue | 88 ++++++++++++- 11 files changed, 208 insertions(+), 132 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/add.yml rename electron/preload/{index.js => index.mjs} (100%) diff --git a/.github/ISSUE_TEMPLATE/add.yml b/.github/ISSUE_TEMPLATE/add.yml deleted file mode 100644 index 115c171a..00000000 --- a/.github/ISSUE_TEMPLATE/add.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 添加功能 -description: 请填写希望添加的功能的具体信息 -title: 【添加功能】请填写标题 -labels: [add] -body: - - type: input - id: name - validations: - required: true - attributes: - label: "希望添加什么功能?" - placeholder: "请填写功能名称" - - type: textarea - id: other - attributes: - label: "具体信息" - description: "请详细描述希望添加的功能的具体信息" diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index 7c03686c..67c2f473 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -1,6 +1,6 @@ name: 遇到问题 description: 关于使用过程中遇到的问题 -title: 【遇到问题】请填写标题 +title: 请填写标题 labels: [bug] body: - type: input @@ -31,4 +31,4 @@ body: id: other attributes: label: "具体信息" - description: "有需要补充的信息吗?比如控制台的报错什么的" + description: "有需要补充的信息吗?比如控制台的报错什么的( Ctrl + Shift + i 打开控制台 )" diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index e7a68d5c..04dd14ad 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,8 @@ blank_issues_enabled: false contact_links: + - name: 添加功能 + url: https://github.com/imsyy/SPlayer/discussions + about: 新的功能建议和提问答疑请到讨论区发起 - name: 转到讨论区 url: https://github.com/imsyy/SPlayer/discussions about: Issues 用于反馈 Bug, 新的功能建议和提问答疑请到讨论区发起 diff --git a/electron.vite.config.mjs b/electron.vite.config.mjs index 26a1abfd..2da510bb 100644 --- a/electron.vite.config.mjs +++ b/electron.vite.config.mjs @@ -42,7 +42,7 @@ export default defineConfig(({ mode }) => { build: { rollupOptions: { input: { - index: resolve(__dirname, "electron/preload/index.js"), + index: resolve(__dirname, "electron/preload/index.mjs"), }, }, }, diff --git a/electron/main/index.js b/electron/main/index.js index cfcc2774..55a85431 100644 --- a/electron/main/index.js +++ b/electron/main/index.js @@ -121,8 +121,8 @@ class MainProcess { icon: nativeImage.createFromPath(join(__dirname, "../../public/images/icons/favicon.png")), // 预加载 webPreferences: { - devTools: is.dev, - preload: join(__dirname, "../preload/index.js"), + // devTools: is.dev, + preload: join(__dirname, "../preload/index.mjs"), sandbox: false, webSecurity: false, hardwareAcceleration: true, diff --git a/electron/main/startNcmServer.js b/electron/main/startNcmServer.js index 2b8fc101..e716a92a 100644 --- a/electron/main/startNcmServer.js +++ b/electron/main/startNcmServer.js @@ -1,4 +1,4 @@ -const netEaseApi = require("NeteaseCloudMusicApi"); +import netEaseApi from "NeteaseCloudMusicApi"; /** * 启动网易云音乐 API 服务器 diff --git a/electron/preload/index.js b/electron/preload/index.mjs similarity index 100% rename from electron/preload/index.js rename to electron/preload/index.mjs diff --git a/package.json b/package.json index c2d548d9..b82cd25d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "splayer", - "version": "2.0.1", + "version": "2.0.2", "description": "A minimalist music player", "main": "./out/main/index.js", "author": "imsyy", @@ -14,6 +14,7 @@ "npm": ">=9.6.7", "pnpm": ">=8.14.0" }, + "type": "module", "scripts": { "format": "prettier --write .", "lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix", @@ -70,6 +71,6 @@ "vite": "^5.0.11", "vite-plugin-compression": "^0.5.1", "vite-plugin-pwa": "^0.17.4", - "vue": "3.4.4" + "vue": "3.4.8" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d01ebc6f..8b599497 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,7 +55,7 @@ dependencies: version: 5.2.3 pinia: specifier: ^2.1.7 - version: 2.1.7(vue@3.4.4) + version: 2.1.7(vue@3.4.8) pinia-plugin-persistedstate: specifier: ^3.2.1 version: 3.2.1(pinia@2.1.7) @@ -67,7 +67,7 @@ dependencies: version: 6.0.2 vue-router: specifier: ^4.2.5 - version: 4.2.5(vue@3.4.4) + version: 4.2.5(vue@3.4.8) vue-slider-component: specifier: 4.1.0-beta.7 version: 4.1.0-beta.7 @@ -81,7 +81,7 @@ devDependencies: version: 1.6.1 '@vitejs/plugin-vue': specifier: ^5.0.2 - version: 5.0.2(vite@5.0.11)(vue@3.4.4) + version: 5.0.2(vite@5.0.11)(vue@3.4.8) '@vue/eslint-config-prettier': specifier: ^9.0.0 version: 9.0.0(eslint@8.56.0)(prettier@3.1.1) @@ -108,7 +108,7 @@ devDependencies: version: 9.19.2(eslint@8.56.0) naive-ui: specifier: ^2.37.3 - version: 2.37.3(vue@3.4.4) + version: 2.37.3(vue@3.4.8) prettier: specifier: ^3.1.1 version: 3.1.1 @@ -123,7 +123,7 @@ devDependencies: version: 0.17.3(rollup@2.79.1) unplugin-vue-components: specifier: ^0.26.0 - version: 0.26.0(rollup@2.79.1)(vue@3.4.4) + version: 0.26.0(rollup@2.79.1)(vue@3.4.8) vite: specifier: ^5.0.11 version: 5.0.11(sass@1.69.7)(terser@5.26.0) @@ -134,8 +134,8 @@ devDependencies: specifier: ^0.17.4 version: 0.17.4(vite@5.0.11)(workbox-build@7.0.0)(workbox-window@7.0.0) vue: - specifier: 3.4.4 - version: 3.4.4 + specifier: 3.4.8 + version: 3.4.8 packages: @@ -1341,12 +1341,12 @@ packages: css-render: 0.15.12 dev: true - /@css-render/vue3-ssr@0.15.12(vue@3.4.4): + /@css-render/vue3-ssr@0.15.12(vue@3.4.8): resolution: {integrity: sha512-AQLGhhaE0F+rwybRCkKUdzBdTEM/5PZBYy+fSYe1T9z9+yxMuV/k7ZRqa4M69X+EI1W8pa4kc9Iq2VjQkZx4rg==} peerDependencies: vue: ^3.0.11 dependencies: - vue: 3.4.4 + vue: 3.4.8 dev: true /@develar/schema-utils@2.6.5: @@ -2147,7 +2147,7 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitejs/plugin-vue@5.0.2(vite@5.0.11)(vue@3.4.4): + /@vitejs/plugin-vue@5.0.2(vite@5.0.11)(vue@3.4.8): resolution: {integrity: sha512-kEjJHrLb5ePBvjD0SPZwJlw1QTRcjjCA9sB5VyfonoXVBxTS7TMnqL6EkLt1Eu61RDeiuZ/WN9Hf6PxXhPI2uA==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: @@ -2155,42 +2155,42 @@ packages: vue: ^3.2.25 dependencies: vite: 5.0.11(sass@1.69.7)(terser@5.26.0) - vue: 3.4.4 + vue: 3.4.8 dev: true - /@vue/compiler-core@3.4.4: - resolution: {integrity: sha512-U5AdCN+6skzh2bSJrkMj2KZsVkUpgK8/XlxjSRYQZhNPcvt9/kmgIMpFEiTyK+Dz5E1J+8o8//BEIX+bakgVSw==} + /@vue/compiler-core@3.4.8: + resolution: {integrity: sha512-GjAwOydZV6UyVBi1lYW5v4jjfU6wOeyi3vBATKJOwV7muYF0/nZi4kfdJc0pwdT5lXwbbx57lyA2Y356rFpw1A==} dependencies: '@babel/parser': 7.23.6 - '@vue/shared': 3.4.4 + '@vue/shared': 3.4.8 entities: 4.5.0 estree-walker: 2.0.2 source-map-js: 1.0.2 - /@vue/compiler-dom@3.4.4: - resolution: {integrity: sha512-iSwkdDULCN+Vr8z6uwdlL044GJ/nUmECxP9vu7MzEs4Qma0FwDLYvnvRcyO0ZITuu3Os4FptGUDnhi1kOLSaGw==} + /@vue/compiler-dom@3.4.8: + resolution: {integrity: sha512-GsPyji42zmkSJlaDFKXvwB97ukTlHzlFH/iVzPFYz/APnSzuhu/CMFQbsYmrtsnc2yscF39eC4rKzvKR27aBug==} dependencies: - '@vue/compiler-core': 3.4.4 - '@vue/shared': 3.4.4 + '@vue/compiler-core': 3.4.8 + '@vue/shared': 3.4.8 - /@vue/compiler-sfc@3.4.4: - resolution: {integrity: sha512-OTFcU6vUxUNHBcarzkp4g6d25nvcmDvFDzPRvSrIsByFFPRYN+y3b+j9HxYwt6nlWvGyFCe0roeJdJlfYxbCBg==} + /@vue/compiler-sfc@3.4.8: + resolution: {integrity: sha512-3ZcurOa6bQdZ6VZLtMqYSUZqpsMqfX0MC3oCxQG0VIJFCqouZAgRYJN1c8QvGs7HW5wW8aXVvUOQU0ILVlYHKA==} dependencies: '@babel/parser': 7.23.6 - '@vue/compiler-core': 3.4.4 - '@vue/compiler-dom': 3.4.4 - '@vue/compiler-ssr': 3.4.4 - '@vue/shared': 3.4.4 + '@vue/compiler-core': 3.4.8 + '@vue/compiler-dom': 3.4.8 + '@vue/compiler-ssr': 3.4.8 + '@vue/shared': 3.4.8 estree-walker: 2.0.2 magic-string: 0.30.5 postcss: 8.4.33 source-map-js: 1.0.2 - /@vue/compiler-ssr@3.4.4: - resolution: {integrity: sha512-1DU9DflSSQlx/M61GEBN+NbT/anUki2ooDo9IXfTckCeKA/2IKNhY8KbG3x6zkd3KGrxzteC7de6QL88vEb41Q==} + /@vue/compiler-ssr@3.4.8: + resolution: {integrity: sha512-nxN79LHeAemhBpIa2PQ6rz57cW7W4C/XIJCOMSn2g49u6q2ekirmJI0osAOTErQPApOR0KwP2QyeTexX4zQCrw==} dependencies: - '@vue/compiler-dom': 3.4.4 - '@vue/shared': 3.4.4 + '@vue/compiler-dom': 3.4.8 + '@vue/shared': 3.4.8 /@vue/devtools-api@6.5.1: resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==} @@ -2210,35 +2210,35 @@ packages: - '@types/eslint' dev: true - /@vue/reactivity@3.4.4: - resolution: {integrity: sha512-DFsuJBf6sfhd5SYzJmcBTUG9+EKqjF31Gsk1NJtnpJm9liSZ806XwGJUeNBVQIanax7ODV7Lmk/k17BgxXNuTg==} + /@vue/reactivity@3.4.8: + resolution: {integrity: sha512-UJYMQ3S2rqIGw9IvKomD4Xw2uS5VlcKEEmwcfboGOdrI79oqebxnCgTvXWLMClvg3M5SF0Cyn+9eDQoyGMLu9Q==} dependencies: - '@vue/shared': 3.4.4 + '@vue/shared': 3.4.8 - /@vue/runtime-core@3.4.4: - resolution: {integrity: sha512-zWWwNQAj5JdxrmOA1xegJm+c4VtyIbDEKgQjSb4va5v7gGTCh0ZjvLI+htGFdVXaO9bs2J3C81p5p+6jrPK8Bw==} + /@vue/runtime-core@3.4.8: + resolution: {integrity: sha512-sMRXOy89KnwY6fWG5epgPOsCWzpo/64FrA0QkjIeNeGnoA2YyZ6bBUxpFUyqhJ8VbrDhXEFH+6LHMOYrpzX/ZQ==} dependencies: - '@vue/reactivity': 3.4.4 - '@vue/shared': 3.4.4 + '@vue/reactivity': 3.4.8 + '@vue/shared': 3.4.8 - /@vue/runtime-dom@3.4.4: - resolution: {integrity: sha512-Nlh2ap1J/eJQ6R0g+AIRyGNwpTJQACN0dk8I8FRLH8Ev11DSvfcPOpn4+Kbg5xAMcuq0cHB8zFYxVrOgETrrvg==} + /@vue/runtime-dom@3.4.8: + resolution: {integrity: sha512-L4gZcYo8f3d7rQqQIHkPvyczkjjQ55cJqz2G0v6Ptmqa1mO2zkqN9F8lBT6aGPYy3hd0RDiINbs4jxhSvvy10Q==} dependencies: - '@vue/runtime-core': 3.4.4 - '@vue/shared': 3.4.4 + '@vue/runtime-core': 3.4.8 + '@vue/shared': 3.4.8 csstype: 3.1.3 - /@vue/server-renderer@3.4.4(vue@3.4.4): - resolution: {integrity: sha512-+AjoiKcC41k7SMJBYkDO9xs79/Of8DiThS9mH5l2MK+EY0to3psI0k+sElvVqQvsoZTjHMEuMz0AEgvm2T+CwA==} + /@vue/server-renderer@3.4.8(vue@3.4.8): + resolution: {integrity: sha512-pBeHM59Owevr3P0Fl1XOjBmq4DTy5JDcjMG4NuzJEVDlZYzY8fHybx0wdjkY5lK5mCtUyBtw6Mz4d87aosc1Sw==} peerDependencies: - vue: 3.4.4 + vue: 3.4.8 dependencies: - '@vue/compiler-ssr': 3.4.4 - '@vue/shared': 3.4.4 - vue: 3.4.4 + '@vue/compiler-ssr': 3.4.8 + '@vue/shared': 3.4.8 + vue: 3.4.8 - /@vue/shared@3.4.4: - resolution: {integrity: sha512-abSgiVRhfjfl3JALR/cSuBl74hGJ3SePgf1mKzodf1eMWLwHZbfEGxT2cNJSsNiw44jEgrO7bNkhchaWA7RwNw==} + /@vue/shared@3.4.8: + resolution: {integrity: sha512-ChLCWzXiJboQ009oVkemhEoUdrxHme7v3ip+Kh+/kDDeF1WtHWGt0knRLGm1Y4YqCRTSs9QxsZIY8paJj5Szrw==} /@xmldom/xmldom@0.8.10: resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==} @@ -5142,13 +5142,13 @@ packages: - supports-color dev: false - /naive-ui@2.37.3(vue@3.4.4): + /naive-ui@2.37.3(vue@3.4.8): resolution: {integrity: sha512-aUkHFXVIluSi8Me+npbcsdv1NYhVMj5t9YaruoCESlqmfqspj+R2QHEVXkTtUI1kQwVrABMCtAGq/wountqjZA==} peerDependencies: vue: ^3.0.0 dependencies: '@css-render/plugin-bem': 0.15.12(css-render@0.15.12) - '@css-render/vue3-ssr': 0.15.12(vue@3.4.4) + '@css-render/vue3-ssr': 0.15.12(vue@3.4.8) '@types/katex': 0.16.7 '@types/lodash': 4.14.202 '@types/lodash-es': 4.17.12 @@ -5163,10 +5163,10 @@ packages: lodash-es: 4.17.21 seemly: 0.3.8 treemate: 0.3.11 - vdirs: 0.1.8(vue@3.4.4) - vooks: 0.2.12(vue@3.4.4) - vue: 3.4.4 - vueuc: 0.4.58(vue@3.4.4) + vdirs: 0.1.8(vue@3.4.8) + vooks: 0.2.12(vue@3.4.8) + vue: 3.4.8 + vueuc: 0.4.58(vue@3.4.8) dev: true /nanoid@3.3.7: @@ -5495,10 +5495,10 @@ packages: peerDependencies: pinia: ^2.0.0 dependencies: - pinia: 2.1.7(vue@3.4.4) + pinia: 2.1.7(vue@3.4.8) dev: false - /pinia@2.1.7(vue@3.4.4): + /pinia@2.1.7(vue@3.4.8): resolution: {integrity: sha512-+C2AHFtcFqjPih0zpYuvof37SFxMQ7OEG2zV9jRI12i9BOy3YQVAHwdKtyyc8pDcDyIc33WCIsZaCFWU7WWxGQ==} peerDependencies: '@vue/composition-api': ^1.4.0 @@ -5511,8 +5511,8 @@ packages: optional: true dependencies: '@vue/devtools-api': 6.5.1 - vue: 3.4.4 - vue-demi: 0.14.6(vue@3.4.4) + vue: 3.4.8 + vue-demi: 0.14.6(vue@3.4.8) dev: false /pkg-types@1.0.3: @@ -6722,7 +6722,7 @@ packages: - rollup dev: true - /unplugin-vue-components@0.26.0(rollup@2.79.1)(vue@3.4.4): + /unplugin-vue-components@0.26.0(rollup@2.79.1)(vue@3.4.8): resolution: {integrity: sha512-s7IdPDlnOvPamjunVxw8kNgKNK8A5KM1YpK5j/p97jEKTjlPNrA0nZBiSfAKKlK1gWZuyWXlKL5dk3EDw874LQ==} engines: {node: '>=14'} peerDependencies: @@ -6745,7 +6745,7 @@ packages: minimatch: 9.0.3 resolve: 1.22.8 unplugin: 1.6.0 - vue: 3.4.4 + vue: 3.4.8 transitivePeerDependencies: - rollup - supports-color @@ -6821,13 +6821,13 @@ packages: engines: {node: '>= 0.8'} dev: false - /vdirs@0.1.8(vue@3.4.4): + /vdirs@0.1.8(vue@3.4.8): resolution: {integrity: sha512-H9V1zGRLQZg9b+GdMk8MXDN2Lva0zx72MPahDKc30v+DtwKjfyOSXWRIX4t2mhDubM1H09gPhWeth/BJWPHGUw==} peerDependencies: vue: ^3.0.11 dependencies: evtd: 0.2.4 - vue: 3.4.4 + vue: 3.4.8 dev: true /verror@1.10.0: @@ -6918,16 +6918,16 @@ packages: fsevents: 2.3.3 dev: true - /vooks@0.2.12(vue@3.4.4): + /vooks@0.2.12(vue@3.4.8): resolution: {integrity: sha512-iox0I3RZzxtKlcgYaStQYKEzWWGAduMmq+jS7OrNdQo1FgGfPMubGL3uGHOU9n97NIvfFDBGnpSvkWyb/NSn/Q==} peerDependencies: vue: ^3.0.0 dependencies: evtd: 0.2.4 - vue: 3.4.4 + vue: 3.4.8 dev: true - /vue-demi@0.14.6(vue@3.4.4): + /vue-demi@0.14.6(vue@3.4.8): resolution: {integrity: sha512-8QA7wrYSHKaYgUxDA5ZC24w+eHm3sYCbp0EzcDwKqN3p6HqtTCGR/GVsPyZW92unff4UlcSh++lmqDWN3ZIq4w==} engines: {node: '>=12'} hasBin: true @@ -6939,7 +6939,7 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.4.4 + vue: 3.4.8 dev: false /vue-eslint-parser@9.4.0(eslint@8.56.0): @@ -6960,46 +6960,46 @@ packages: - supports-color dev: true - /vue-router@4.2.5(vue@3.4.4): + /vue-router@4.2.5(vue@3.4.8): resolution: {integrity: sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw==} peerDependencies: vue: ^3.2.0 dependencies: '@vue/devtools-api': 6.5.1 - vue: 3.4.4 + vue: 3.4.8 dev: false /vue-slider-component@4.1.0-beta.7: resolution: {integrity: sha512-Qb7K920ZG7PoQswoF6Ias+i3W2rd3k4fpk04JUl82kEUcN86Yg6et7bVSKWt/7VpQe8a5IT3BqCKSCOZ7AJgCA==} dev: false - /vue@3.4.4: - resolution: {integrity: sha512-suZXgDVT8lRNhKmxdkwOsR0oyUi8is7mtqI18qW97JLoyorEbE9B2Sb4Ws/mR/+0AgA/JUtsv1ytlRSH3/pDIA==} + /vue@3.4.8: + resolution: {integrity: sha512-vJffFOe6DqWsAI10v3tDhb1nJrj7CF3CbdQwOznywAsFNoyvrQ1AWQdcIWJpmRpRnw7NFzstzh6fh4w7n1PNdg==} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@vue/compiler-dom': 3.4.4 - '@vue/compiler-sfc': 3.4.4 - '@vue/runtime-dom': 3.4.4 - '@vue/server-renderer': 3.4.4(vue@3.4.4) - '@vue/shared': 3.4.4 + '@vue/compiler-dom': 3.4.8 + '@vue/compiler-sfc': 3.4.8 + '@vue/runtime-dom': 3.4.8 + '@vue/server-renderer': 3.4.8(vue@3.4.8) + '@vue/shared': 3.4.8 - /vueuc@0.4.58(vue@3.4.4): + /vueuc@0.4.58(vue@3.4.8): resolution: {integrity: sha512-Wnj/N8WbPRSxSt+9ji1jtDHPzda5h2OH/0sFBhvdxDRuyCZbjGg3/cKMaKqEoe+dErTexG2R+i6Q8S/Toq1MYg==} peerDependencies: vue: ^3.0.11 dependencies: - '@css-render/vue3-ssr': 0.15.12(vue@3.4.4) + '@css-render/vue3-ssr': 0.15.12(vue@3.4.8) '@juggle/resize-observer': 3.4.0 css-render: 0.15.12 evtd: 0.2.4 seemly: 0.3.8 - vdirs: 0.1.8(vue@3.4.4) - vooks: 0.2.12(vue@3.4.4) - vue: 3.4.4 + vdirs: 0.1.8(vue@3.4.8) + vooks: 0.2.12(vue@3.4.8) + vue: 3.4.8 dev: true /webidl-conversions@4.0.2: diff --git a/src/components/Modal/LoginPhone.vue b/src/components/Modal/LoginPhone.vue index fb03badc..b746faaf 100644 --- a/src/components/Modal/LoginPhone.vue +++ b/src/components/Modal/LoginPhone.vue @@ -104,36 +104,39 @@ const getCaptcha = (phone) => { // 手机号登录 const phoneLogin = (e) => { - e.preventDefault(); - phoneFormRef.value?.validate(async (errors) => { - if (!errors) { - const verifyRes = await verifyCaptcha( - phoneFormData._value.phone, - phoneFormData._value.captcha, - ); - console.log(verifyRes); - if (verifyRes.code == 200) { - const result = await toLogin(phoneFormData._value.phone, phoneFormData._value.captcha); - console.log(result); - if (result.code === 200) { - // 去除 HTTPOnly - result.cookie = result.cookie.replaceAll(" HTTPOnly", ""); - // 是否含有 MUSIC_U - if (result.cookie && result.cookie.includes("MUSIC_U")) { - // 储存登录信息 - emit("setLoginData", result); - } else { - $message.error("登录出错,请重试"); + try { + e.preventDefault(); + phoneFormRef.value?.validate(async (errors) => { + if (!errors) { + const verifyRes = await verifyCaptcha( + phoneFormData._value.phone, + phoneFormData._value.captcha, + ); + console.log(verifyRes); + if (verifyRes.code == 200) { + const result = await toLogin(phoneFormData._value.phone, phoneFormData._value.captcha); + console.log(result); + if (result.code === 200) { + // 去除 HTTPOnly + result.cookie = result.cookie.replaceAll(" HTTPOnly", ""); + // 是否含有 MUSIC_U + if (result.cookie && result.cookie.includes("MUSIC_U")) { + // 储存登录信息 + emit("setLoginData", result); + } else { + $message.error("登录出错,请重试"); + } } - } else { - phoneFormData.value.captcha = null; - $message.error("登录出错,请重试"); } + } else { + $message.error("请检查你的输入"); } - } else { - $message.error("请检查你的输入"); - } - }); + }); + } catch (error) { + phoneFormData.value.captcha = null; + console.error("登录出错:", error); + $message.error("登录出错,请重试"); + } }; diff --git a/src/components/Player/PlayerControl.vue b/src/components/Player/PlayerControl.vue index a5a58a96..673da49f 100644 --- a/src/components/Player/PlayerControl.vue +++ b/src/components/Player/PlayerControl.vue @@ -131,6 +131,46 @@ > + + + + + +