You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.7 KiB
Go
43 lines
1.7 KiB
Go
package errx
|
|
|
|
import (
|
|
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/code"
|
|
"git.noahlan.cn/noahlan/ntool-biz/core/nstatus/msg"
|
|
)
|
|
|
|
// Common
|
|
const (
|
|
WrongCode code.Code = iota + 1000 // 验证码错误
|
|
WrongCaptcha // 验证码错误
|
|
WrongPassword // 密码错误
|
|
UserNotFound // 用户不存在
|
|
NeedPhoneOrEmail // 请输入正确的手机号或邮箱
|
|
UnsupportedLoginType // 暂未支持此类型登录方式
|
|
)
|
|
|
|
// User register
|
|
const (
|
|
UsernameAlreadyExists code.Code = iota + 1100 // 用户名已注册
|
|
PasswordInvalidArgument // 密码格式错误
|
|
UserPhoneNumberAlreadyExists // 手机号码已被绑定
|
|
UserExists // 用户已存在
|
|
UserNicknameAlreadyExists // 用户昵称已存在
|
|
UserEmailAlreadyExists // 此邮箱已被注册
|
|
)
|
|
|
|
func init() {
|
|
msg.Add(WrongCode, "auth.wrongCode")
|
|
msg.Add(WrongCaptcha, "auth.wrongCaptcha")
|
|
msg.Add(WrongPassword, "auth.wrongPassword")
|
|
msg.Add(UserNotFound, "auth.userNotFound")
|
|
msg.Add(NeedPhoneOrEmail, "auth.needPhoneOrEmail")
|
|
msg.Add(UnsupportedLoginType, "auth.unsupportedLoginType")
|
|
|
|
msg.Add(UsernameAlreadyExists, "register.user.usernameExists")
|
|
msg.Add(PasswordInvalidArgument, "register.user.passwordInvalid")
|
|
msg.Add(UserPhoneNumberAlreadyExists, "register.user.phoneNumberExists")
|
|
msg.Add(UserExists, "register.user.exists")
|
|
msg.Add(UserNicknameAlreadyExists, "register.user.nicknameExists")
|
|
msg.Add(UserEmailAlreadyExists, "register.user.emailExists")
|
|
}
|