feat(projects): add request exception example page

This commit is contained in:
Soybean
2024-03-24 06:23:56 +08:00
parent 11a6a3bd80
commit 41e8bc44f8
11 changed files with 175 additions and 16 deletions

View File

@ -279,6 +279,7 @@ declare namespace App {
search: string;
switch: string;
tip: string;
trigger: string;
update: string;
updateSuccess: string;
userCenter: string;
@ -287,6 +288,14 @@ declare namespace App {
no: string;
};
};
request: {
logout: string;
logoutMsg: string;
logoutWithModal: string;
logoutWithModalMsg: string;
refreshToken: string;
tokenExpired: string;
};
theme: {
themeSchema: { title: string } & Record<UnionKey.ThemeScheme, string>;
layoutMode: { title: string } & Record<UnionKey.ThemeLayoutMode, string>;

View File

@ -31,6 +31,7 @@ declare module "@elegant-router/types" {
"function_hide-child_three": "/function/hide-child/three";
"function_hide-child_two": "/function/hide-child/two";
"function_multi-tab": "/function/multi-tab";
"function_request": "/function/request";
"function_tab": "/function/tab";
"home": "/home";
"login": "/login/:module(pwd-login|code-login|register|reset-pwd|bind-wechat)?";
@ -117,6 +118,7 @@ declare module "@elegant-router/types" {
| "function_hide-child_three"
| "function_hide-child_two"
| "function_multi-tab"
| "function_request"
| "function_tab"
| "home"
| "manage_menu"

30
src/typings/env.d.ts vendored
View File

@ -27,6 +27,36 @@ declare namespace Env {
readonly VITE_ICON_LOCAL_PREFIX: 'local-icon';
/** backend service base url */
readonly VITE_SERVICE_BASE_URL: string;
/**
* success code of backend service
*
* when the code is received, the request is successful
*/
readonly VITE_SERVICE_SUCCESS_CODE: string;
/**
* logout codes of backend service
*
* when the code is received, the user will be logged out and redirected to login page
*
* use "," to separate multiple codes
*/
readonly VITE_SERVICE_LOGOUT_CODES: string;
/**
* modal logout codes of backend service
*
* when the code is received, the user will be logged out by displaying a modal
*
* use "," to separate multiple codes
*/
readonly VITE_SERVICE_MODAL_LOGOUT_CODES: string;
/**
* token expired codes of backend service
*
* when the code is received, it will refresh the token and resend the request
*
* use "," to separate multiple codes
*/
readonly VITE_SERVICE_EXPIRED_TOKEN_CODES: string;
/**
* other backend service base url
*