[feat] 调整验证码
This commit is contained in:
parent
ef1d73c764
commit
d0a72dfd0b
@ -8,6 +8,6 @@ import (
|
||||
|
||||
type Captcha interface {
|
||||
HttpMiddleware(container *do.Injector) func(next http.Handler) http.Handler
|
||||
Verify(answer, salt string, clear bool) error
|
||||
Generate(captchaUuid string, u User) (answer, salt string, err error)
|
||||
Verify(id int64, answer string, clear bool) error
|
||||
Generate(captchaUuid, recipient, ip string, u User) (body string, id int64, err error)
|
||||
}
|
||||
|
17
errno.go
17
errno.go
@ -79,17 +79,11 @@ var (
|
||||
ErrUserWechatRegister = &Errno{Code: 20309, Msg: "通过微信注册失败"}
|
||||
|
||||
// 审批错误, 前缀是 204
|
||||
// 审批节点不存在
|
||||
ErrUserApprovalFlowNotFound = &Errno{Code: 20401, Msg: "审批节点不存在"}
|
||||
// 下级审批节点不存在
|
||||
ErrUserApprovalNextFlowNotFound = &Errno{Code: 20402, Msg: "下级审批节点不存在"}
|
||||
// 该审批已结束
|
||||
ErrUserApprovalFlowDone = &Errno{Code: 20403, Msg: "该审批已结束"}
|
||||
// 该审批已撤销
|
||||
ErrUserApprovalFlowCancelled = &Errno{Code: 20404, Msg: "该审批已撤销"}
|
||||
// 超过自动扭转最大深度
|
||||
ErrUserApprovalMaxExecuteDeep = &Errno{Code: 20405, Msg: "该审批已超过自动扭转最大深度撤销"}
|
||||
// 该审批流已占用
|
||||
ErrUserApprovalExists = &Errno{Code: 20406, Msg: "该审批流已被占用"}
|
||||
|
||||
// 请求第三个接口
|
||||
@ -97,11 +91,12 @@ var (
|
||||
ErrApiResponsed = &Errno{Code: 20502, Msg: "Api Responsed Error"}
|
||||
|
||||
// 验证码错误,206
|
||||
ErrCaptcha = &Errno{Code: 20600, Msg: "验证码错误"}
|
||||
ErrCaptchaInvalid = &Errno{Code: 20601, Msg: "验证码错误"}
|
||||
ErrCaptchaExpired = &Errno{Code: 20602, Msg: "验证码已过期"}
|
||||
ErrCaptchaSend = &Errno{Code: 20603, Msg: "验证码发送错误"}
|
||||
ErrCaptchaSendInterval = &Errno{Code: 20604, Msg: "验证码发送失败, 请稍后再试"}
|
||||
ErrCaptcha = &Errno{Code: 20601, Msg: "验证码生成器不存在"}
|
||||
ErrCaptchaGenerate = &Errno{Code: 20602, Msg: "验证码生成错误"}
|
||||
ErrCaptchaInvalid = &Errno{Code: 20603, Msg: "验证码无效"}
|
||||
ErrCaptchaExpired = &Errno{Code: 20604, Msg: "验证码已过期"}
|
||||
ErrCaptchaSend = &Errno{Code: 20605, Msg: "验证码发送错误"}
|
||||
ErrCaptchaSendInterval = &Errno{Code: 20606, Msg: "验证码发送失败, 请稍后再试"}
|
||||
)
|
||||
|
||||
// 使用 错误码 和 error 创建新的 错误
|
||||
|
Loading…
Reference in New Issue
Block a user