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'