fix: 登陆增加参数校验 (#2751)

pull/2760/head
ssongliu 1 year ago committed by GitHub
parent 94ca229e71
commit 0b67c8dfc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 {

@ -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 == '') {

Loading…
Cancel
Save