Merge huangzhenbao-admin into main and fix config

This commit is contained in:
comlibmb
2026-01-27 21:43:26 +08:00
65 changed files with 13313 additions and 1547 deletions

View File

@@ -219,7 +219,18 @@ export class AkReq {
await new Promise<void>((r) => { setTimeout(() => { r(); }, delay); });
attempt++;
}
return lastRes!!;
const finalRes = lastRes!!;
// 全局处理 401 未授权:在非 refresh 场景下,清理 token 并跳转登录以避免未捕获错误
if ((finalRes.status === 401) && (skipRefresh !== true)) {
try {
this.clearToken();
uni.showToast({ title: '未授权或登录已过期,请重新登录', icon: 'none' });
} catch (e) {}
try {
uni.reLaunch({ url: '/pages/user/login' });
} catch (e) {}
}
return finalRes;
}
// 新增 upload 方法,支持 uni.uploadFile自动带 token/apikey