mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-08 01:20:07 +08:00
fix: 登陆增加参数校验 (#2751)
This commit is contained in:
parent
94ca229e71
commit
0b67c8dfc9
@ -28,8 +28,8 @@ type Login struct {
|
|||||||
IgnoreCaptcha bool `json:"ignoreCaptcha"`
|
IgnoreCaptcha bool `json:"ignoreCaptcha"`
|
||||||
Captcha string `json:"captcha"`
|
Captcha string `json:"captcha"`
|
||||||
CaptchaID string `json:"captchaID"`
|
CaptchaID string `json:"captchaID"`
|
||||||
AuthMethod string `json:"authMethod"`
|
AuthMethod string `json:"authMethod" validate:"required,oneof=jwt session"`
|
||||||
Language string `json:"language"`
|
Language string `json:"language" validate:"required,oneof=zh en tw"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MFALogin struct {
|
type MFALogin struct {
|
||||||
|
@ -179,7 +179,7 @@ const loginForm = reactive({
|
|||||||
ignoreCaptcha: true,
|
ignoreCaptcha: true,
|
||||||
captcha: '',
|
captcha: '',
|
||||||
captchaID: '',
|
captchaID: '',
|
||||||
authMethod: '',
|
authMethod: 'session',
|
||||||
agreeLicense: false,
|
agreeLicense: false,
|
||||||
language: 'zh',
|
language: 'zh',
|
||||||
});
|
});
|
||||||
@ -195,7 +195,7 @@ const mfaLoginForm = reactive({
|
|||||||
password: '',
|
password: '',
|
||||||
secret: '',
|
secret: '',
|
||||||
code: '',
|
code: '',
|
||||||
authMethod: '',
|
authMethod: 'session',
|
||||||
});
|
});
|
||||||
|
|
||||||
const captcha = reactive({
|
const captcha = reactive({
|
||||||
@ -232,7 +232,7 @@ const login = (formEl: FormInstance | undefined) => {
|
|||||||
ignoreCaptcha: globalStore.ignoreCaptcha,
|
ignoreCaptcha: globalStore.ignoreCaptcha,
|
||||||
captcha: loginForm.captcha,
|
captcha: loginForm.captcha,
|
||||||
captchaID: captcha.captchaID,
|
captchaID: captcha.captchaID,
|
||||||
authMethod: '',
|
authMethod: 'session',
|
||||||
language: loginForm.language,
|
language: loginForm.language,
|
||||||
};
|
};
|
||||||
if (!globalStore.ignoreCaptcha && requestLoginForm.captcha == '') {
|
if (!globalStore.ignoreCaptcha && requestLoginForm.captcha == '') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user