轻松聘
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1.1 KiB

/**
* 账号鉴权领域模型:手机号 + 验证码 / 手机号 + 密码两条登录通道。
* 密码规则的计算与错误码映射放在 src/api 与 src/constants,
* 页面只消费联合类型与文案,不写死判断逻辑。
*/
/**
* 密码规则校验失败原因;null 表示通过校验。
* 用联合类型建模派生状态,便于 Record<PasswordRuleError, string> 反向约束文案配置完整性。
*/
export type PasswordRuleError =
/** 未填写 */
| 'empty'
/** 少于最小长度 */
| 'too-short'
/** 超过最大长度 */
| 'too-long'
/** 未同时包含字母和数字 */
| 'need-letter-digit'
/** 两次输入不一致 */
| 'mismatch'
/** 新密码与原密码相同 */
| 'same-as-old';
/** 重置 / 首次设置密码参数(忘记密码与首次设密码共用) */
export interface PasswordResetPayload {
phone: string;
code: string;
password: string;
}
/** 已登录态修改密码参数 */
export interface ChangePasswordPayload {
oldPassword: string;
newPassword: string;
/** 确认新密码(前端二次输入,后端可忽略) */
confirmPassword: string;
}