调整文件结构;跑通admin端;初步设计页面结构

This commit is contained in:
2026-01-22 18:19:15 +08:00
parent 67ef2d6d6d
commit 2b0ee0c8b6
31 changed files with 5798 additions and 198 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