From b6310e1b24f501d563fa26a1c147523380189661 Mon Sep 17 00:00:00 2001 From: binaryify Date: Tue, 7 May 2024 15:30:04 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E8=BF=94=E5=9B=9E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.MD | 4 ++++ package.json | 2 +- public/eapi_decrypt.html | 10 ++++++---- util/crypto.js | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 619d809..6d7e013 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -1,5 +1,9 @@ # 更新日志 +### 4.19.1 | 2024.05.07 + +- 返回数据优化 + ### 4.19.0 | 2024.05.07 - 云贝签到接口替换 diff --git a/package.json b/package.json index a7a0f24..ed355f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "4.19.0", + "version": "4.19.1", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", diff --git a/public/eapi_decrypt.html b/public/eapi_decrypt.html index 7a2d4cb..a5f5996 100644 --- a/public/eapi_decrypt.html +++ b/public/eapi_decrypt.html @@ -22,7 +22,9 @@
-

解密结果: {{ result }}

+

解密结果: +

{{ JSON.stringify(JSON.parse(result), null, 2) }}
+

@@ -34,7 +36,7 @@ data() { return { hexString: 'AD96DDB984491E79B6F429DD650C6E2AE524627AC223AC9A123C66BB0997965950FED137544A93DFC718E16F57C8C121AF537086F395570A5602A3922366D11964DAFACD7830AACABF62E5650E67F457E79C1D2E13502391FC3487216CC5BF8681843FCB8E05559487EB18AAC1BE0EFEA4F7B6A050478366153A9426C238B8869600B275704555A9EB94C92E4F3FDABE9E0BCE07645410D0AA7B675698A4CAE6CD3620633ABF0B849A4244CC8DFC5DB2646D5EA9B3954E62BFEF19AFEAFDDC34E55C3E9A1DD3167CF53D443617108141', - result: '', + result: '{}', isFormat: true } }, @@ -48,11 +50,11 @@ url: `/eapi/decrypt?hexString=${this.hexString}&isFormat=${this.isFormat}`, method: 'post' }) - this.result = res.data + this.result = JSON.stringify(res.data) console.log(res.data); } catch (error) { console.error(error) - alert(error.response.data.message) + alert(error?.response?.data?.message || '解密失败,数据格式错误') } } } diff --git a/util/crypto.js b/util/crypto.js index c7ab882..64d58d4 100644 --- a/util/crypto.js +++ b/util/crypto.js @@ -88,7 +88,7 @@ const eapi = (url, object) => { const eapiResDecrypt = (encryptedParams) => { // 使用aesDecrypt解密参数 const decryptedData = aesDecrypt(encryptedParams, eapiKey, '', 'hex') - return decryptedData + return JSON.parse(decryptedData) } const eapiReqDecrypt = (encryptedParams) => { // 使用aesDecrypt解密参数