sync: 以本地为准同步全量变更至 GitHub
含四端需求文档、前端/后端/超管/触客宝迭代及部署脚本更新;未拉取远程。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -51,9 +51,10 @@ export async function apiRequest(
|
||||
|
||||
// 如果接口返回的code不是200,抛出错误
|
||||
if (data && data.code !== 200) {
|
||||
// 如果是认证错误,清除登录信息
|
||||
if (data.code === 401) {
|
||||
// 认证失效:清 token 并跳转登录,避免各页表格只显示「授权已过期或无效」
|
||||
if (data.code === 401 && typeof window !== 'undefined') {
|
||||
clearAdminInfo();
|
||||
window.location.href = '/login';
|
||||
}
|
||||
throw data; // 抛出响应结果作为错误
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user