视频提词优化管理后台配置build dist merge

This commit is contained in:
2026-06-22 14:42:18 +08:00
10 changed files with 649 additions and 33 deletions
+5 -1
View File
@@ -110,7 +110,11 @@ export async function apiRequest<T>(path: string, options: RequestOptions = {}):
const msg = parsed?.detail || `请求失败 (${res.status})`;
if (res.status === 401) {
clearToken();
window.location.href = '/login';
// Only redirect to login if not already on login page
const currentPath = window.location.pathname;
if (currentPath !== '/login') {
window.location.href = '/login';
}
}
throw new Error(msg);
}
+3 -2
View File
@@ -41,8 +41,9 @@ const AdminLoginPage = () => {
await login(values.username, values.password, values.rememberMe);
message.success('登录成功');
navigate('/');
} catch {
message.error('登录失败');
} catch (error: any) {
const errorMsg = error?.message || '登录失败';
message.error(errorMsg);
} finally {
setLoading(false);
}