From 0e2cc28235738a5be67e9deb821ac190e4ce3e29 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Wed, 5 Aug 2026 23:48:13 -0600 Subject: [PATCH] =?UTF-8?q?refactor(signup):=20=E5=8E=BB=E6=8E=89=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E9=AA=8C=E8=AF=81=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 后端已移除验证码功能。 - Signup.vue 删表单项、验证码图、getCaptchaSrc、打开弹窗拉图的 watch、 "Invalid captcha" 错误分支和 .captcha 样式 - authModal store 删 signupForm.captcha、captchaSrc、setCaptchaSrc - api.ts 删 getCaptcha(),signup() 参数去掉 captcha Co-Authored-By: Claude Opus 5 --- src/shared/api.ts | 5 ---- src/shared/components/Signup.vue | 40 ++------------------------------ src/shared/store/authModal.ts | 15 ------------ 3 files changed, 2 insertions(+), 58 deletions(-) diff --git a/src/shared/api.ts b/src/shared/api.ts index 0a9660e..939a4cb 100644 --- a/src/shared/api.ts +++ b/src/shared/api.ts @@ -9,7 +9,6 @@ export function signup(data: { username: string email: string password: string - captcha: string }) { return http.post("register", data) } @@ -26,10 +25,6 @@ export function getProblemTagList() { return http.get("problem/tags") } -export function getCaptcha() { - return http.get("captcha") -} - export function getHitokoto() { return http.get("hitokoto") } diff --git a/src/shared/components/Signup.vue b/src/shared/components/Signup.vue index a06d6e7..1e22389 100644 --- a/src/shared/components/Signup.vue +++ b/src/shared/components/Signup.vue @@ -1,5 +1,5 @@ - - diff --git a/src/shared/store/authModal.ts b/src/shared/store/authModal.ts index 1a58c61..5a8f42b 100644 --- a/src/shared/store/authModal.ts +++ b/src/shared/store/authModal.ts @@ -25,15 +25,11 @@ export const useAuthModalStore = defineStore("authModal", () => { email: "", password: "", passwordAgain: "", - captcha: "", }) const signupLoading = ref(false) const signupError = ref("") - // ==================== 验证码 ==================== - const captchaSrc = ref("") - // ==================== 模态框操作 ==================== /** * 打开登录模态框 @@ -123,13 +119,6 @@ export const useAuthModalStore = defineStore("authModal", () => { signupError.value = "" } - /** - * 设置验证码图片地址 - */ - function setCaptchaSrc(src: string) { - captchaSrc.value = src - } - return { // 模态框状态 loginModalOpen, @@ -145,9 +134,6 @@ export const useAuthModalStore = defineStore("authModal", () => { signupLoading, signupError, - // 验证码 - captchaSrc, - // 模态框操作 openLoginModal, closeLoginModal, @@ -165,6 +151,5 @@ export const useAuthModalStore = defineStore("authModal", () => { setSignupLoading, setSignupError, clearSignupError, - setCaptchaSrc, } })