refactor: ♻️ 重构API为静态方法实现模块化管理,并将types.ts重命名为model.ts用于存放接口模型定义
This commit is contained in:
59
src/api/auth/model.ts
Normal file
59
src/api/auth/model.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* 登录请求参数
|
||||
*/
|
||||
export interface LoginData {
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
username: string;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
password: string;
|
||||
|
||||
/**
|
||||
* 验证码缓存key
|
||||
*/
|
||||
captchaKey?: string;
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
captchaCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录响应
|
||||
*/
|
||||
export interface LoginResult {
|
||||
/**
|
||||
* 访问token
|
||||
*/
|
||||
accessToken?: string;
|
||||
/**
|
||||
* 过期时间(单位:毫秒)
|
||||
*/
|
||||
expires?: number;
|
||||
/**
|
||||
* 刷新token
|
||||
*/
|
||||
refreshToken?: string;
|
||||
/**
|
||||
* token 类型
|
||||
*/
|
||||
tokenType?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证码响应
|
||||
*/
|
||||
export interface CaptchaResult {
|
||||
/**
|
||||
* 验证码缓存key
|
||||
*/
|
||||
captchaKey: string;
|
||||
/**
|
||||
* 验证码图片Base64字符串
|
||||
*/
|
||||
captchaBase64: string;
|
||||
}
|
||||
Reference in New Issue
Block a user