Commit c4b898c5 by 泽锋 李

fix

parent 049dc0cc
......@@ -23,6 +23,10 @@ namespace AutoTurnOver.Common
public static UserData GetUser()
{
var token = MyHttpContext.Current.Request.Headers["Authorization"];
if (string.IsNullOrWhiteSpace(token))
{
token = MyHttpContext.Current.Request.Query["token"].FirstOrDefault();
}
var tokenDecode = WebUtility.UrlDecode(token);
var dd = new JwtSecurityToken(tokenDecode.Replace("Bearer ", ""));
var userId = dd.Claims.FirstOrDefault(m => m.Type == "UserId").Value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment