From 0b67c8dfc90f7f79250f73ed50eca45379d20cfa Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Wed, 1 Nov 2023 13:48:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=99=BB=E9=99=86=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C=20(#2751)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/dto/auth.go | 4 ++-- frontend/src/views/login/components/login-form.vue | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/app/dto/auth.go b/backend/app/dto/auth.go index 9f46df000..ccaa2ec12 100644 --- a/backend/app/dto/auth.go +++ b/backend/app/dto/auth.go @@ -28,8 +28,8 @@ type Login struct { IgnoreCaptcha bool `json:"ignoreCaptcha"` Captcha string `json:"captcha"` CaptchaID string `json:"captchaID"` - AuthMethod string `json:"authMethod"` - Language string `json:"language"` + AuthMethod string `json:"authMethod" validate:"required,oneof=jwt session"` + Language string `json:"language" validate:"required,oneof=zh en tw"` } type MFALogin struct { diff --git a/frontend/src/views/login/components/login-form.vue b/frontend/src/views/login/components/login-form.vue index 563242bf1..71d849172 100644 --- a/frontend/src/views/login/components/login-form.vue +++ b/frontend/src/views/login/components/login-form.vue @@ -179,7 +179,7 @@ const loginForm = reactive({ ignoreCaptcha: true, captcha: '', captchaID: '', - authMethod: '', + authMethod: 'session', agreeLicense: false, language: 'zh', }); @@ -195,7 +195,7 @@ const mfaLoginForm = reactive({ password: '', secret: '', code: '', - authMethod: '', + authMethod: 'session', }); const captcha = reactive({ @@ -232,7 +232,7 @@ const login = (formEl: FormInstance | undefined) => { ignoreCaptcha: globalStore.ignoreCaptcha, captcha: loginForm.captcha, captchaID: captcha.captchaID, - authMethod: '', + authMethod: 'session', language: loginForm.language, }; if (!globalStore.ignoreCaptcha && requestLoginForm.captcha == '') {