pull/1420/head
lyswhut 2023-05-01 11:47:34 +08:00
parent 1cbe46dc3b
commit 851851a7e6
5 changed files with 6 additions and 12 deletions

View File

@ -1,6 +1,7 @@
import { httpFetch } from '../../request' import { httpFetch } from '../../request'
import { decodeName, formatPlayTime, sizeFormate } from '../../index' import { decodeName, formatPlayTime, sizeFormate } from '../../index'
import { formatSingerName } from '@renderer/utils/musicSdk/utils' import { formatSingerName } from '../utils'
export default { export default {
limit: 30, limit: 30,

View File

@ -1,6 +1,6 @@
import { formatSingerName } from '@renderer/utils/musicSdk/utils'
import { decodeName, formatPlayTime, sizeFormate } from '../../index' import { decodeName, formatPlayTime, sizeFormate } from '../../index'
import { signatureParams, createHttpFetch } from './util' import { signatureParams, createHttpFetch } from './util'
import { formatSingerName } from '../../utils'
export default { export default {
limit: 30, limit: 30,

View File

@ -1,7 +1,6 @@
import { httpFetch } from '../../request' import { httpFetch } from '../../request'
import { sizeFormate, formatPlayTime } from '../../index' import { sizeFormate, formatPlayTime } from '../../index'
import { toMD5 } from '../utils' import { toMD5, formatSingerName } from '../utils'
import { formatSingerName } from '@renderer/utils/musicSdk/utils'
const sign = (time, str) => { const sign = (time, str) => {
const deviceId = '963B7AA0D21511ED807EE5846EC87D20' const deviceId = '963B7AA0D21511ED807EE5846EC87D20'

View File

@ -119,7 +119,7 @@ export default {
this._requestObj_list = httpFetch( this._requestObj_list = httpFetch(
this.getListUrl(sortId, tagId, page), 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 }) => { return this._requestObj_list.promise.then(({ body }) => {
if (body.code !== this.successCode) return this.getList(sortId, tagId, page, ++tryNum) 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) return tagId ? this.filterList2(body.playlist.data, page) : this.filterList(body.playlist.data, page)

View File

@ -37,13 +37,7 @@ export const dnsLookup = (hostname, options, callback) => {
* @param join 歌手分割字符 * @param join 歌手分割字符
*/ */
export const formatSingerName = (singers, nameKey = 'name', join = '、') => { export const formatSingerName = (singers, nameKey = 'name', join = '、') => {
if (typeof singers == 'string') { if (Array.isArray(singers)) {
try {
singers = JSON.parse(singers)
} catch (err) {
return decodeName(singers)
}
} else if (Array.isArray(singers)) {
const singer = [] const singer = []
singers.forEach(item => { singers.forEach(item => {
let name = item[nameKey] let name = item[nameKey]