From 851851a7e6ffe3e31ce916d8c089823de86a55df Mon Sep 17 00:00:00 2001 From: lyswhut Date: Mon, 1 May 2023 11:47:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/utils/musicSdk/kg/musicSearch.js | 3 ++- src/renderer/utils/musicSdk/kg/temp/musicSearch-new.js | 2 +- src/renderer/utils/musicSdk/mg/musicSearch.js | 3 +-- src/renderer/utils/musicSdk/tx/songList.js | 2 +- src/renderer/utils/musicSdk/utils.js | 8 +------- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/renderer/utils/musicSdk/kg/musicSearch.js b/src/renderer/utils/musicSdk/kg/musicSearch.js index ee60a694..0893c6c2 100644 --- a/src/renderer/utils/musicSdk/kg/musicSearch.js +++ b/src/renderer/utils/musicSdk/kg/musicSearch.js @@ -1,6 +1,7 @@ import { httpFetch } from '../../request' import { decodeName, formatPlayTime, sizeFormate } from '../../index' -import { formatSingerName } from '@renderer/utils/musicSdk/utils' +import { formatSingerName } from '../utils' + export default { limit: 30, diff --git a/src/renderer/utils/musicSdk/kg/temp/musicSearch-new.js b/src/renderer/utils/musicSdk/kg/temp/musicSearch-new.js index 535fc790..d2e8a581 100644 --- a/src/renderer/utils/musicSdk/kg/temp/musicSearch-new.js +++ b/src/renderer/utils/musicSdk/kg/temp/musicSearch-new.js @@ -1,6 +1,6 @@ -import { formatSingerName } from '@renderer/utils/musicSdk/utils' import { decodeName, formatPlayTime, sizeFormate } from '../../index' import { signatureParams, createHttpFetch } from './util' +import { formatSingerName } from '../../utils' export default { limit: 30, diff --git a/src/renderer/utils/musicSdk/mg/musicSearch.js b/src/renderer/utils/musicSdk/mg/musicSearch.js index 3cb1b7df..96764e84 100644 --- a/src/renderer/utils/musicSdk/mg/musicSearch.js +++ b/src/renderer/utils/musicSdk/mg/musicSearch.js @@ -1,7 +1,6 @@ import { httpFetch } from '../../request' import { sizeFormate, formatPlayTime } from '../../index' -import { toMD5 } from '../utils' -import { formatSingerName } from '@renderer/utils/musicSdk/utils' +import { toMD5, formatSingerName } from '../utils' const sign = (time, str) => { const deviceId = '963B7AA0D21511ED807EE5846EC87D20' diff --git a/src/renderer/utils/musicSdk/tx/songList.js b/src/renderer/utils/musicSdk/tx/songList.js index 345bbb0f..4c33e2a5 100644 --- a/src/renderer/utils/musicSdk/tx/songList.js +++ b/src/renderer/utils/musicSdk/tx/songList.js @@ -119,7 +119,7 @@ export default { this._requestObj_list = httpFetch( this.getListUrl(sortId, tagId, page), ) - console.log(this.getListUrl(sortId, tagId, page)) + // console.log(this.getListUrl(sortId, tagId, page)) return this._requestObj_list.promise.then(({ body }) => { if (body.code !== this.successCode) return this.getList(sortId, tagId, page, ++tryNum) return tagId ? this.filterList2(body.playlist.data, page) : this.filterList(body.playlist.data, page) diff --git a/src/renderer/utils/musicSdk/utils.js b/src/renderer/utils/musicSdk/utils.js index 756cf880..0bbf6325 100644 --- a/src/renderer/utils/musicSdk/utils.js +++ b/src/renderer/utils/musicSdk/utils.js @@ -37,13 +37,7 @@ export const dnsLookup = (hostname, options, callback) => { * @param join 歌手分割字符 */ export const formatSingerName = (singers, nameKey = 'name', join = '、') => { - if (typeof singers == 'string') { - try { - singers = JSON.parse(singers) - } catch (err) { - return decodeName(singers) - } - } else if (Array.isArray(singers)) { + if (Array.isArray(singers)) { const singer = [] singers.forEach(item => { let name = item[nameKey]