fix: set phone prefix when disable verification code (#769)

Signed-off-by: Yixiang Zhao <seriouszyx@foxmail.com>
This commit is contained in:
Yixiang Zhao
2022-05-30 18:26:42 +08:00
committed by GitHub
parent d52caed3a9
commit 42c2210178

View File

@ -222,7 +222,11 @@ func (c *ApiController) Login() {
}
// disable the verification code
object.DisableVerificationCode(form.Username)
if strings.Contains(form.Username, "@") {
object.DisableVerificationCode(form.Username)
} else {
object.DisableVerificationCode(fmt.Sprintf("+%s%s", form.PhonePrefix, form.Username))
}
user = object.GetUserByFields(form.Organization, form.Username)
if user == nil {