diff --git a/helper/captcha.go b/helper/captcha.go index d0e09388..3092703a 100644 --- a/helper/captcha.go +++ b/helper/captcha.go @@ -86,28 +86,28 @@ func CaptchaMake(option CaptchaOption) (string, string) { } -// CaptchaValidate 校验验证码 +// CaptchaValidate Validate the captcha func CaptchaValidate(id string, code string) bool { return captcha.VerifyString(id, code) } -// ProcessCaptchaValidate xiang.helper.CaptchaValidate 校验图形/音频验证码 +// ProcessCaptchaValidate xiang.helper.CaptchaValidate image/audio captcha func ProcessCaptchaValidate(process *process.Process) interface{} { process.ValidateArgNums(2) id := process.ArgsString(0) code := process.ArgsString(1) if code == "" { - exception.New("请输入验证码", 400).Throw() + exception.New("Please enter the captcha.", 400).Throw() return false } if !CaptchaValidate(id, code) { - exception.New("验证码不正确", 400).Throw() + exception.New("Invalid captcha.", 400).Throw() return false } return true } -// ProcessCaptcha xiang.helper.Captcha 校验图形/音频验证码 +// ProcessCaptcha xiang.helper.Captcha image/audio captcha func ProcessCaptcha(process *process.Process) interface{} { process.ValidateArgNums(1) option := CaptchaOption{ diff --git a/helper/password.go b/helper/password.go index 1d5b56c5..67d009e1 100644 --- a/helper/password.go +++ b/helper/password.go @@ -6,11 +6,11 @@ import ( "golang.org/x/crypto/bcrypt" ) -// PasswordValidate 校验密码 +// PasswordValidate Validate the password func PasswordValidate(password string, passwordHash string) bool { err := bcrypt.CompareHashAndPassword([]byte(passwordHash), []byte(password)) if err != nil { - exception.New("密码不正确", 400).Throw() + exception.New("Invalid password.", 400).Throw() return false } return true