mirror of
https://github.com/PlayEdu/backend
synced 2025-12-23 11:19:45 +08:00
错误页面
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user