From 5e15f20d67c0e29e393ffd45105716f3dfc99274 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 5 Jun 2021 16:12:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=BC=80kg=E6=BA=90?= =?UTF-8?q?=E6=AD=8C=E5=8D=95=E9=93=BE=E6=8E=A5=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 1 + src/utils/music/kg/songList.js | 1 + src/utils/music/utils.js | 4 ++-- src/utils/request.js | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 9b393a3..0e7c6af 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -8,3 +8,4 @@ - 修复打开歌单失败时会导致应用崩溃的问题 - 修复打开kw歌单失败时会无限重试的问题 - 尝试修复弹出菜单、列表位置不正确的问题 +- 修复打开kg源歌单链接失败的问题 diff --git a/src/utils/music/kg/songList.js b/src/utils/music/kg/songList.js index f815e05..2552741 100644 --- a/src/utils/music/kg/songList.js +++ b/src/utils/music/kg/songList.js @@ -154,6 +154,7 @@ export default { async createHttp(url, options, retryNum = 0) { if (retryNum > 2) throw new Error('try max num') let result + options.cache = 'default' try { result = await httpFetch(url, options).promise } catch (err) { diff --git a/src/utils/music/utils.js b/src/utils/music/utils.js index b7ba8e5..4335e05 100644 --- a/src/utils/music/utils.js +++ b/src/utils/music/utils.js @@ -1,4 +1,4 @@ -// import crypto from 'crypto' +import crypto from 'crypto' /** * 获取音乐音质 @@ -18,4 +18,4 @@ export const getMusicType = (info, type) => { return '128k' } -// export const toMD5 = str => crypto.createHash('md5').update(str).digest('hex') +export const toMD5 = str => crypto.createHash('md5').update(str).digest('hex') diff --git a/src/utils/request.js b/src/utils/request.js index 56cc0eb..0555d13 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -101,13 +101,14 @@ const handleRequestData = async(url, { method = 'get', headers = {}, format = 'json', + cache = 'no-store', ...options }) => { // console.log(url, options) headers = Object.assign({ Accept: 'application/json', }, headers) - options.cache = 'no-store' + options.cache = cache if (method.toLocaleLowerCase() === 'post' && !headers['Content-Type']) { if (options.form) { headers['Content-Type'] = 'application/x-www-form-urlencoded'