diff --git a/errno.go b/errno.go index 8a146d2..e2ff848 100644 --- a/errno.go +++ b/errno.go @@ -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: "无权限"} diff --git a/user.go b/user.go index 6d3f3e0..f2b8fae 100644 --- a/user.go +++ b/user.go @@ -17,6 +17,8 @@ type User interface { HasUserRoles(roles ...string) bool // 平台 Platform() string + // 是否匿名用户 + IsAnonymous() bool } // 用户