♻️ 重构战绩数据请求逻辑,完善错误处理,适配新版本地图数据

This commit is contained in:
BTMuli
2026-04-09 01:39:56 +08:00
parent 6d34b7cb65
commit 2e8ec962b6
7 changed files with 208 additions and 70 deletions

View File

@@ -125,9 +125,7 @@ async function request<T>(
} catch (error) {
// 清除超时定时器
clearTimeout(timeoutId);
let httpError: TGApp.App.Response.HttpErr;
if (typeof error === "object" && error !== null && "message" in error) {
httpError = <TGApp.App.Response.HttpErr>error;
} else if (error instanceof Error) {
@@ -135,8 +133,6 @@ async function request<T>(
} else {
httpError = createHttpError(String(error), { cause: error });
}
// 记录错误日志 TODO根据实际情况调整日志
// await TGLogger.Error(`[TGHttps] Request failed: ${httpError.message}`);
throw httpError;
}
}