fix
This commit is contained in:
parent
d139ea2cee
commit
aa5b90e0d4
|
@ -60,19 +60,19 @@ func ParseJwtToken(r *http.Request, svcCtx any) (*auth.UserInfo, error) {
|
|||
// log.Println(io.ReadAll(r.Body))
|
||||
token := r.Header.Get("Authorization")
|
||||
userId, err := strconv.ParseInt(token, 10, 64)
|
||||
if err != nil {
|
||||
|
||||
if err == nil {
|
||||
userinfo = &auth.UserInfo{
|
||||
UserId: userId,
|
||||
}
|
||||
} else {
|
||||
var secret uint64 = 0
|
||||
|
||||
token, info, err := auth.ParseJwtTokenHeader[auth.UserInfo](r) //解析Token头, 和payload信息
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return nil, err
|
||||
}
|
||||
log.Println("!= 0", info)
|
||||
|
||||
if info != nil {
|
||||
if info.IsUser() {
|
||||
// us, err := state.GetUserState(info.UserId) //获取缓存的用户状态
|
||||
|
|
Loading…
Reference in New Issue
Block a user