发送列表时过滤没有数据的
This commit is contained in:
parent
2083f5f8fa
commit
b420d48aaf
@ -96,10 +96,11 @@
|
|||||||
onmessage: async (event, client) => {
|
onmessage: async (event, client) => {
|
||||||
const { type, id, channel, list } = JSON.parse(event.data)
|
const { type, id, channel, list } = JSON.parse(event.data)
|
||||||
if (type === 'get_music_list') {
|
if (type === 'get_music_list') {
|
||||||
console.log(client.name, '请求音乐列表:', musicList.list)
|
const ms = musicList.list.filter(item => item.arrayBuffer)
|
||||||
|
console.log(client.name, '请求音乐列表:', ms)
|
||||||
clientList.send('base', JSON.stringify({
|
clientList.send('base', JSON.stringify({
|
||||||
type: 'set_music_list',
|
type: 'set_music_list',
|
||||||
list: musicList.list.map(({ id, name, size, type }) => ({ id, name, size, type }))
|
list: ms.map(({ id, name, size, type }) => ({ id, name, size, type }))
|
||||||
}))
|
}))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user