优化弹幕加载提示

This commit is contained in:
mtvpls
2025-12-04 20:17:25 +08:00
parent cc5563bff2
commit e2d0a62c2a
4 changed files with 53 additions and 10 deletions
+5 -5
View File
@@ -19,7 +19,7 @@ export async function searchAnime(
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
throw new Error('弹幕服务器连接异常,请检查你的设置');
}
const data = (await response.json()) as DanmakuSearchResponse;
@@ -52,7 +52,7 @@ export async function matchAnime(
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
throw new Error('弹幕服务器连接异常,请检查你的设置');
}
const data = (await response.json()) as DanmakuMatchResponse;
@@ -78,7 +78,7 @@ export async function getEpisodes(
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
throw new Error('弹幕服务器连接异常,请检查你的设置');
}
const data = (await response.json()) as DanmakuEpisodesResponse;
@@ -107,7 +107,7 @@ export async function getDanmakuById(
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
throw new Error('弹幕服务器连接异常,请检查你的设置');
}
const data = (await response.json()) as DanmakuCommentsResponse;
@@ -125,7 +125,7 @@ export async function getDanmakuByUrl(url: string): Promise<DanmakuComment[]> {
const response = await fetch(apiUrl);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
throw new Error('弹幕服务器连接异常,请检查你的设置');
}
const data = (await response.json()) as DanmakuCommentsResponse;