From e61862bd42247f1c455ead84b37d94a6d9e83f55 Mon Sep 17 00:00:00 2001 From: what Date: Wed, 27 Dec 2023 10:22:43 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E5=8C=BA=E5=88=86=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=97=A0=E6=9D=83=E9=99=90=E5=92=8C=E6=9C=AA=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- errno.go | 1 + user.go | 2 ++ 2 files changed, 3 insertions(+) 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 } // 用户