initial commit

This commit is contained in:
yangsy
2025-08-13 01:36:30 +08:00
commit 202f83d157
78 changed files with 5896 additions and 0 deletions

28
src/apis/client.ts Normal file
View File

@@ -0,0 +1,28 @@
import type { AxiosError } from 'axios';
import { Request } from '@/utils/request';
export const ndmClient = new Request({
requestInterceptor: (config) => {
return config;
},
responseInterceptor: (response) => {
return response;
},
responseErrorInterceptor: (error) => {
return Promise.reject(error);
},
});
export const userClient = new Request({
responseErrorInterceptor: (error) => {
const err = error as AxiosError;
if (err.response?.status === 401) {
// TODO: 处理 401 错误,例如跳转到登录页
}
if (err.response?.status === 404) {
// TODO: 处理 404 错误
}
return Promise.reject(error);
},
});