1、泛型化参数,预留泛型约束,方便以后代码扩展的类型安全校验

2、升级goframe至v2.7.3
This commit is contained in:
apefuu
2024-09-19 19:33:00 +08:00
parent 2a87055b62
commit f18ce6384b
57 changed files with 221 additions and 220 deletions

View File

@@ -90,7 +90,7 @@ func Login(ctx context.Context, user *model.Identity) (string, int64, error) {
}
// Logout 注销登录
func Logout(r *ghttp.Request) (err error) {
func Logout[T any](r *ghttp.Request) (err error) {
var (
ctx = r.Context()
header = GetAuthorization(r)
@@ -112,9 +112,9 @@ func Logout(r *ghttp.Request) (err error) {
// 认证key
authKey = GetAuthKey(header)
// 登录token
tokenKey = GetTokenKey(contexts.GetModule(ctx), authKey)
tokenKey = GetTokenKey(contexts.GetModule[T](ctx), authKey)
// 身份绑定
bindKey = GetBindKey(contexts.GetModule(ctx), claims.Id)
bindKey = GetBindKey(contexts.GetModule[T](ctx), claims.Id)
)
// 删除token