generated from arvinxx/monorepo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,62 @@ | ||
export namespace IUserLogin { | ||
export type LoginType = 'account' | 'mobile'; | ||
/** | ||
* 登录方式 | ||
*/ | ||
export type LoginType = | ||
/** | ||
* 账号密码登录 | ||
*/ | ||
| 'account' | ||
/** | ||
* 手机验证码登录 | ||
*/ | ||
| 'mobile'; | ||
|
||
export interface LoginStatus { | ||
/** | ||
* 登录状态 | ||
*/ | ||
status?: 'ok' | 'error'; | ||
/** | ||
* 用户登录方式 | ||
*/ | ||
type?: LoginType; | ||
/** | ||
* 登录的用户类型 | ||
*/ | ||
currentAuthority?: 'user' | 'guest'; | ||
} | ||
|
||
/** | ||
* 账号登录参数 | ||
*/ | ||
export interface AccountLoginParams { | ||
userName: string; | ||
password: string; | ||
} | ||
|
||
/** | ||
* 验证码登录参数 | ||
*/ | ||
export interface MobileLoginParams { | ||
mobile: string; | ||
captcha: string; | ||
} | ||
|
||
/** | ||
* 统一登录参数 | ||
*/ | ||
export interface LoginParams extends AccountLoginParams, MobileLoginParams {} | ||
|
||
/** | ||
* 发送登录请求参数 | ||
*/ | ||
export interface RequestParams extends Partial<LoginParams> { | ||
type: LoginType; | ||
} | ||
|
||
/** | ||
* 登录提交按钮方法 | ||
*/ | ||
export type LoginSubmit = (values: RequestParams) => Promise<void>; | ||
} |