[feat] 区分用户无权限和未登录

This commit is contained in:
what 2023-12-27 10:22:43 +08:00
parent e1fc968fb2
commit e61862bd42
2 changed files with 3 additions and 0 deletions

View File

@ -64,6 +64,7 @@ var (
ErrTokenNotFound = &Errno{Code: 20202, Msg: "token 不存在"}
// 用户错误, 前缀为 203
ErrUserNotLogin = &Errno{Code: 20300, Msg: "请登录"}
ErrUserNotFound = &Errno{Code: 20301, Msg: "用户没找到"}
ErrUserPassword = &Errno{Code: 20302, Msg: "用户名或密码错误"}
ErrUserAuth = &Errno{Code: 20303, Msg: "无权限"}

View File

@ -17,6 +17,8 @@ type User interface {
HasUserRoles(roles ...string) bool
// 平台
Platform() string
// 是否匿名用户
IsAnonymous() bool
}
// 用户