fix: QQ 音乐未登录时搜索给出明确提示(接口对匿名请求返回空结果)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -101,6 +101,10 @@ export class QQProvider implements MusicProvider {
|
||||
param: { query: keyword, num_per_page: limit, page_num: page, search_type: 0 },
|
||||
});
|
||||
const list: any[] = data?.body?.song?.list || [];
|
||||
// QQ 音乐搜索接口对未登录请求一律返回空结果
|
||||
if (!list.length && !this.client.auth) {
|
||||
throw Object.assign(new Error('QQ 音乐搜索需要先登录(设置 → 扫码登录)'), { status: 400 });
|
||||
}
|
||||
return { items: list.map((t) => this.toSummary(t)), total: data?.meta?.sum ?? list.length, page, limit };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user