This commit is contained in:
eson 2023-08-28 17:25:27 +08:00
parent 8c30648d3e
commit a4fe298420

View File

@ -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)