This commit is contained in:
eson
2023-08-28 17:20:08 +08:00
parent f41bea0201
commit 8c30648d3e
19 changed files with 5 additions and 1647 deletions

View File

@@ -70,8 +70,11 @@ func ParseJwtToken(r *http.Request, svcCtx any) (*auth.UserInfo, error) {
if info != nil {
if info.IsUser() {
// us, err := state.GetUserState(info.UserId) //获取缓存的用户状态
reflect.ValueOf(svcCtx)
ctxValue := reflect.ValueOf(svcCtx).FieldByName("MysqlConn")
rsvcCtx := reflect.ValueOf(svcCtx)
if rsvcCtx.Kind() == reflect.Ptr {
rsvcCtx = rsvcCtx.Elem()
}
ctxValue := rsvcCtx.FieldByName("MysqlConn")
gdb := ctxValue.Interface().(*gorm.DB)
us, err := shared.GetUserState(info.UserId, gdb)