From a4fe2984201bdfa3dc9b6906b24fa6d29e59d2ac Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Mon, 28 Aug 2023 17:25:27 +0800 Subject: [PATCH] fix --- utils/basic/request_parse.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/basic/request_parse.go b/utils/basic/request_parse.go index 0cbcfc34..89c53220 100644 --- a/utils/basic/request_parse.go +++ b/utils/basic/request_parse.go @@ -70,10 +70,14 @@ func ParseJwtToken(r *http.Request, svcCtx any) (*auth.UserInfo, error) { if info != nil { if info.IsUser() { // us, err := state.GetUserState(info.UserId) //获取缓存的用户状态 + log.Println(svcCtx) + rsvcCtx := reflect.ValueOf(svcCtx) + log.Println(rsvcCtx, rsvcCtx.Type()) if rsvcCtx.Kind() == reflect.Ptr { rsvcCtx = rsvcCtx.Elem() } + ctxValue := rsvcCtx.FieldByName("MysqlConn") gdb := ctxValue.Interface().(*gorm.DB) us, err := shared.GetUserState(info.UserId, gdb)