mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-02-04 05:33:17 +08:00
46 lines
697 B
TypeScript
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
|
||
|
|
}
|