From 00f0f111d899aa7b509464f6fd0b13bad4929337 Mon Sep 17 00:00:00 2001 From: Ap_Tx <3045929398@qq.com> Date: Sat, 17 Oct 2026 18:42:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=9A=AE=E8=82=A4?= =?UTF-8?q?=E7=AB=99=E5=8E=9F=E7=94=9F=E7=99=BB=E5=BD=95=E4=B8=8E=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 登录入口原先会切到主页并打开内嵌网页。改为弹出启动器自己的登录弹窗: - SkinSiteLoginModal:账号密码校验规则与皮肤站一致,登录前走验证码, 成功后保存 JWT 并刷新会话。 - SkinSiteCaptchaModal:拉取旋转图片验证码,用滑块调整角度后提交。 - AccountsCard 的登录按钮改为打开该弹窗,登录成功后重新拉取玩家列表。 - 修正 verifyCaptcha 的参数:服务端校验的是旋转角度 degree,不是文字答案。 --- .../src/components/ui/AccountsCard.vue | 18 +- .../ui/skin-site/SkinSiteCaptchaModal.vue | 155 ++++++++++++++++++ .../ui/skin-site/SkinSiteLoginModal.vue | 146 +++++++++++++++++ .../app-frontend/src/helpers/skin-site-api.ts | 6 +- 4 files changed, 312 insertions(+), 13 deletions(-) create mode 100644 apps/app-frontend/src/components/ui/skin-site/SkinSiteCaptchaModal.vue create mode 100644 apps/app-frontend/src/components/ui/skin-site/SkinSiteLoginModal.vue diff --git a/apps/app-frontend/src/components/ui/AccountsCard.vue b/apps/app-frontend/src/components/ui/AccountsCard.vue index 0656c99..7727808 100644 --- a/apps/app-frontend/src/components/ui/AccountsCard.vue +++ b/apps/app-frontend/src/components/ui/AccountsCard.vue @@ -244,6 +244,7 @@ + + + diff --git a/apps/app-frontend/src/components/ui/skin-site/SkinSiteLoginModal.vue b/apps/app-frontend/src/components/ui/skin-site/SkinSiteLoginModal.vue new file mode 100644 index 0000000..7e8df94 --- /dev/null +++ b/apps/app-frontend/src/components/ui/skin-site/SkinSiteLoginModal.vue @@ -0,0 +1,146 @@ + + + diff --git a/apps/app-frontend/src/helpers/skin-site-api.ts b/apps/app-frontend/src/helpers/skin-site-api.ts index 1d0a723..97fc534 100644 --- a/apps/app-frontend/src/helpers/skin-site-api.ts +++ b/apps/app-frontend/src/helpers/skin-site-api.ts @@ -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('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> { return skinSiteRequest('verifyCaptcha', { method: 'POST', body: payload, auth: false }) }