ai页面修改

This commit is contained in:
sjy
2026-07-02 18:10:56 +08:00
parent b39dae6d55
commit 9edaeb4031
9 changed files with 2185 additions and 2160 deletions
+4 -1
View File
@@ -110,7 +110,10 @@ export async function apiRequest<T>(path: string, options: RequestOptions = {}):
// Handle error responses
if (!res.ok) {
const msg = parsed?.detail || `请求失败 (${res.status})`;
let msg = parsed?.detail?.message || parsed?.message || `请求失败 (${res.status})`;
if (typeof parsed?.detail === 'string') {
msg = parsed.detail;
}
if (res.status === 401 && !options.skipAuthRedirect) {
clearToken();
window.location.href = '/login';