Files
xingrin/frontend/types/auth.types.ts
2025-12-12 18:04:57 +08:00

46 lines
697 B
TypeScript

/**
* 认证相关类型定义
*/
// 用户信息
export interface User {
id: number
username: string
isStaff: boolean
isSuperuser: boolean
}
// 登录请求
export interface LoginRequest {
username: string
password: string
}
// 登录响应
export interface LoginResponse {
message: string
user: User
}
// 获取当前用户响应
export interface MeResponse {
authenticated: boolean
user: User | null
}
// 登出响应
export interface LogoutResponse {
message: string
}
// 修改密码请求
export interface ChangePasswordRequest {
oldPassword: string
newPassword: string
}
// 修改密码响应
export interface ChangePasswordResponse {
message: string
}