From fc966787b4e5ac1a9c6127ba0a0031cee7c22417 Mon Sep 17 00:00:00 2001 From: what Date: Mon, 29 Jan 2024 22:35:35 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E6=96=B0=E5=A2=9E=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E9=94=99=E8=AF=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- errno.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/errno.go b/errno.go index 9e89a7f..9278b8d 100644 --- a/errno.go +++ b/errno.go @@ -55,16 +55,16 @@ var ( ErrDatabase = &Errno{Code: 20100, Msg: "数据库错误"} ErrDBFill = &Errno{Code: 20101, Msg: "从数据库填充 struct 时发生错误"} ErrDBQuery = &Errno{Code: 20102, Msg: "数据查询错误"} - ErrDBStore = &Errno{Code: 20102, Msg: "数据保存错误"} - ErrDBUpdate = &Errno{Code: 20103, Msg: "数据更新错误"} - ErrDBDelete = &Errno{Code: 20104, Msg: "数据删除错误"} - ErrDBTransaction = &Errno{Code: 20105, Msg: "数据库事务错误"} + ErrDBStore = &Errno{Code: 20103, Msg: "数据保存错误"} + ErrDBUpdate = &Errno{Code: 20104, Msg: "数据更新错误"} + ErrDBDelete = &Errno{Code: 20105, Msg: "数据删除错误"} + ErrDBTransaction = &Errno{Code: 20106, Msg: "数据库事务错误"} // 认证错误, 前缀是 202 ErrTokenValidation = &Errno{Code: 20201, Msg: "验证失败"} ErrTokenInvalid = &Errno{Code: 20202, Msg: "token 无效"} - ErrTokenExpired = &Errno{Code: 20202, Msg: "token 过期"} - ErrTokenNotFound = &Errno{Code: 20202, Msg: "token 不存在"} + ErrTokenExpired = &Errno{Code: 20203, Msg: "token 过期"} + ErrTokenNotFound = &Errno{Code: 20204, Msg: "token 不存在"} // 用户错误, 前缀为 203 ErrUserNotLogin = &Errno{Code: 20300, Msg: "请先登录"} @@ -95,6 +95,13 @@ var ( // 请求第三个接口 ErrApiRequest = &Errno{Code: 20501, Msg: "Api Request Error"} 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: "验证码发送失败, 请稍后再试"} ) // 使用 错误码 和 error 创建新的 错误