feat(open): 重构C端认证并支持密码重置

This commit is contained in:
2026-08-17 09:29:42 +08:00
parent 0591ff67d0
commit 7687ef4f37
18 changed files with 500 additions and 187 deletions

View File

@@ -11,25 +11,7 @@ public interface OpenAuthService {
CaptchaInfo getCaptcha();
/**
* 发送注册短信验证码
*
* @param mobile 手机号
*/
boolean sendRegisterSmsCode(String mobile);
/**
* 手机号注册
*
* @param mobile 手机号
* @param code 验证码
* @param password 密码
* @param nickname 昵称
* @return 认证令牌
*/
AuthenticationToken registerByMobile(String mobile, String code, String password, String nickname);
/**
* 发送登录短信验证码
* 发送登录/注册短信验证码(用户存在则用于登录,不存在则用于注册)
*
* @param mobile 手机号
*/
@@ -53,11 +35,28 @@ public interface OpenAuthService {
*/
AuthenticationToken login(String username, String password);
/**
* 发送重置密码短信验证码
*
* @param mobile 手机号
*/
boolean sendResetPwdSmsCode(String mobile);
/**
* 重置密码
*
* @param mobile 手机号
* @param code 短信验证码
* @param password 新密码
*/
void resetPassword(String mobile, String code, String password);
/**
* 退出登录
*
* @param accessToken 访问令牌(可选,为空时仅清理当前上下文)
*/
void logout();
void logout(String accessToken);
/**
* 刷新令牌