Skip to content

Commit 7daa32a

Browse files
author
sunshine824
committed
fetch.js优化,更好支持typescript
1 parent d049614 commit 7daa32a

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

src/api/types/user.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
// 登录参数
2-
export interface ILoginApiParams {
3-
username: string // 用户名
4-
password: string // 密码
5-
captcha: string // 验证码
6-
uuid: string // 验证码uuid
7-
}
8-
1+
/**
2+
* 接口返回结果Types
3+
* --------------------------------------------------------------------------
4+
*/
95
// 登录返回结果
106
export interface ILoginData {
117
token: string
@@ -15,12 +11,28 @@ export interface ILoginData {
1511
}
1612
}
1713

14+
/**
15+
* 接口参数Types
16+
* --------------------------------------------------------------------------
17+
*/
18+
// 登录参数
19+
export interface ILoginApiParams {
20+
username: string // 用户名
21+
password: string // 密码
22+
captcha: string // 验证码
23+
uuid: string // 验证码uuid
24+
}
25+
1826
// 注销登录参数
1927
export interface ILogoutParams {}
2028

2129
// 获取用户权限参数
2230
export interface IPermissionsParams {}
2331

32+
/**
33+
* 接口定义Types
34+
* --------------------------------------------------------------------------
35+
*/
2436
export interface IUserApi {
2537
login: (params: ILoginApiParams) => Promise<StoreState.ResType<ILoginData>>
2638
logout: (params: ILogoutParams) => Promise<StoreState.ResType<any>>

0 commit comments

Comments
 (0)