feat: 新增皮肤站原生登录与验证码弹窗
Sync source to CNB / Sync Git ref (push) Skipped

登录入口原先会切到主页并打开内嵌网页。改为弹出启动器自己的登录弹窗:

- SkinSiteLoginModal:账号密码校验规则与皮肤站一致,登录前走验证码,
  成功后保存 JWT 并刷新会话。
- SkinSiteCaptchaModal:拉取旋转图片验证码,用滑块调整角度后提交。
- AccountsCard 的登录按钮改为打开该弹窗,登录成功后重新拉取玩家列表。
- 修正 verifyCaptcha 的参数:服务端校验的是旋转角度 degree,不是文字答案。
This commit is contained in:
AxTps committed 2026-10-17 18:42:34 +08:00
1 parent 0edf96fc2c
commit 00f0f111d8
4 files changed
+312 -13

No files matched your search

@@ -1,5 +1,4 @@
import { fetch as tauriFetch } from '@tauri-apps/plugin-http'
export const SKIN_SITE_ORIGIN = 'https://skin.starlight.cool'
/** Where the skin site stores the JWT for this launcher. Kept separate from
@@ -204,11 +203,10 @@ export function requestCaptcha(): Promise<SkinSiteResponse<SkinSiteCaptchaRequir
return skinSiteRequest<SkinSiteCaptchaRequire>('captcha', { auth: false })
}
/** Submit the captcha answer; resolves to the clientId to use for login/register. */
/** Submit the captcha rotation angle; resolves to the clientId used for login/register. */
export function verifyCaptcha(payload: {
clientId: string
answer: string
[key: string]: unknown
degree: number
}): Promise<SkinSiteResponse<string>> {
return skinSiteRequest<string>('verifyCaptcha', { method: 'POST', body: payload, auth: false })
}