feat(player): 玩家端短信找回密码

支持手机号验证码重置密码,重置成功后跳转登录页;SMS 增加 reset_password 场景与 purpose 隔离。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-12 13:12:00 +08:00
parent e140861a2b
commit ff89c31b51
16 changed files with 597 additions and 13 deletions

View File

@@ -30,7 +30,11 @@ export function useSmsCode() {
}, 1000);
}
async function send(phone: string, countryCode: string) {
async function send(
phone: string,
countryCode: string,
purpose: 'register' | 'reset_password' = 'register',
) {
if (countdown.value > 0 || sending.value) return;
const trimmed = phone.trim();
const dial = countryCode.replace(/\D/g, '');
@@ -46,6 +50,7 @@ export function useSmsCode() {
phone: trimmed,
countryCode: dial,
locale,
purpose,
});
sessionId.value = data.data.sessionId;
startCountdown();