From 6f3c1e32360712cb98845500356348cb8862b66a Mon Sep 17 00:00:00 2001 From: Deng Ming Date: Wed, 29 May 2024 23:13:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20redis=20session=20?= =?UTF-8?q?=E6=96=AD=E8=A8=80=E7=9A=84=E9=94=99=E8=AF=AF=EF=BC=8C=E4=BB=A5?= =?UTF-8?q?=E6=96=B9=E4=BE=BF=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- session/redis/provider.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/session/redis/provider.go b/session/redis/provider.go index d7fef27..14ccbe0 100644 --- a/session/redis/provider.go +++ b/session/redis/provider.go @@ -139,7 +139,8 @@ func (rsp *SessionProvider) extractTokenString(ctx *ginx.Context) string { // Get 返回 Session,如果没有拿到 session 或者 session 已经过期,会返回 error func (rsp *SessionProvider) Get(ctx *gctx.Context) (session.Session, error) { val, _ := ctx.Get(session.CtxSessionKey) - res, ok := val.(*Session) + // 对接口断言,而不是对实现断言 + res, ok := val.(session.Session) if ok { return res, nil }