Files
Auto_Bangumi/types/api.ts

24 lines
449 B
TypeScript

export type AuthError = 'Not authenticated';
export type LoginError = 'Password error' | 'User not found';
export type ApiErrorMessage = AuthError | LoginError;
/**
* 401 Token 过期
* 404 Not Found
* 406 Not Acceptable
* 500 Internal Server Error
*/
export type StatusCode = 401 | 404 | 406 | 500;
export type ApiError = {
status: StatusCode;
detail: ApiErrorMessage;
msg: string;
};
export interface ApiSuccess {
msg: string;
}