feat: improve verification error translation (#1660)

This commit is contained in:
Yaodong Yu
2023-03-15 23:44:38 +08:00
committed by GitHub
parent 312412ffe4
commit fd883a3211
14 changed files with 52 additions and 53 deletions

View File

@ -224,8 +224,8 @@ func (c *ApiController) ResetEmailOrPhone() {
return
}
}
if msg := object.CheckVerificationCode(checkDest, code, c.GetAcceptLanguage()); len(msg) != 0 {
c.ResponseError(msg)
if result := object.CheckVerificationCode(checkDest, code, c.GetAcceptLanguage()); result.Code != object.VerificationSuccess {
c.ResponseError(result.Msg)
return
}