|
|
|
@ -60,11 +60,20 @@ export default function PlayerCard({ show, className }: Prop) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const res: FetchResponse<Promise<string>> = await clientHttp.get(lrcUrl);
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
const lrc = (await res.data) || '';
|
|
|
|
|
setLrcData(lrc);
|
|
|
|
|
}
|
|
|
|
|
fetch(lrcUrl)
|
|
|
|
|
.then((response) => {
|
|
|
|
|
if (!response.ok) {
|
|
|
|
|
throw new Error('Network response was not ok');
|
|
|
|
|
}
|
|
|
|
|
return response.text(); // 假设文件是文本格式
|
|
|
|
|
})
|
|
|
|
|
.then((data) => {
|
|
|
|
|
const lrc = data || '';
|
|
|
|
|
setLrcData(lrc);
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
console.error('There was a problem with the fetch operation:', error);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 清空列表
|
|
|
|
|