|
|
@ -70,7 +70,7 @@ func JWT(opts ...JwtOption) middleware.Middleware { |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
if needAuth && userInfo.UserId == 0 { |
|
|
|
if needAuth && userInfo.UserId == "" { |
|
|
|
return errors.Unauthorized("TOKEN_BAD", "") |
|
|
|
return errors.Unauthorized("TOKEN_BAD", "") |
|
|
|
} |
|
|
|
} |
|
|
|
if authKey != "" { |
|
|
|
if authKey != "" { |
|
|
@ -78,7 +78,7 @@ func JWT(opts ...JwtOption) middleware.Middleware { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if userInfo.UserId > 0 { |
|
|
|
if userInfo.UserId != "" { |
|
|
|
ctx = SetUserContext(ctx, userInfo) |
|
|
|
ctx = SetUserContext(ctx, userInfo) |
|
|
|
} |
|
|
|
} |
|
|
|
return nil |
|
|
|
return nil |
|
|
|