错误页面

This commit is contained in:
unknown
2023-07-29 17:58:39 +08:00
parent 23d0e6265c
commit 5f959f3719
4 changed files with 62 additions and 22 deletions

View File

@@ -3,7 +3,7 @@ import client from "./internal/httpClient";
export function adminLogList(
page: number,
size: number,
admin_id: number | null,
admin_id: string,
title: string,
opt: string,
start_time: string,

View File

@@ -7,8 +7,8 @@ const GoLogin = () => {
window.location.href = "/login";
};
const GoError = () => {
window.location.href = "/error";
const GoError = (code: number) => {
window.location.href = "/error?code=" + code;
};
export class HttpClient {
@@ -56,13 +56,16 @@ export class HttpClient {
GoLogin();
} else if (status === 404) {
// 跳转到404页面
GoError();
GoError(404);
} else if (status === 403) {
// 跳转到无权限页面
GoError();
GoError(403);
} else if (status === 429) {
// 跳转到429页面
GoError(429);
} else if (status === 500) {
// 跳转到500异常页面
GoError();
GoError(500);
}
return Promise.reject(error.response);
}