fix: 统一管理后台 401 与加载失败处理

This commit is contained in:
Nixevol
2026-09-30 15:12:16 +08:00
parent eff4bd53be
commit 898b9d2934
17 changed files with 473 additions and 47 deletions
+1 -3
View File
@@ -22,9 +22,7 @@ async function run<T>(fn: () => Promise<T>, silent = false): Promise<T> {
try {
return await fn();
} catch (e) {
if (!silent && e instanceof ApiError) {
message.error(e.message);
} else if (!silent && e instanceof Error) {
if (!silent && e instanceof Error && !(e instanceof ApiError)) {
message.error(e.message);
}
throw e;