File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
开发版dev/Vue.NetCore/Vue.Net/VOL.Core/Filters Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,19 @@ public void OnAuthorization(AuthorizationFilterContext context)
5050 //限定一个帐号不能在多处登陆 UserContext.Current.Token != ((ClaimsIdentity)context.HttpContext.User.Identity)?.BootstrapContext?.ToString()
5151
5252 // &&UserContext.Current.UserName!="admin666"为演示环境,实际使用时去掉此条件
53- if ( ! context . HttpContext . User . Identity . IsAuthenticated
54- || (
55- UserContext . Current . Token != ( ( ClaimsIdentity ) context . HttpContext . User . Identity )
56- ? . BootstrapContext ? . ToString ( )
57- && UserContext . Current . UserName != "admin666"
58- ) )
59- {
60- Console . Write ( $ "IsAuthenticated:{ context . HttpContext . User . Identity . IsAuthenticated } ," +
61- $ "userToken{ UserContext . Current . Token } " +
62- $ "BootstrapContext:{ ( ( ClaimsIdentity ) context . HttpContext . User . Identity ) ? . BootstrapContext ? . ToString ( ) } ") ;
63- context . Unauthorized ( "登陆已过期" ) ;
64- return ;
65- }
53+ // if (!context.HttpContext.User.Identity.IsAuthenticated
54+ // || (
55+ // UserContext.Current.Token != ((ClaimsIdentity)context.HttpContext.User.Identity)
56+ // ?.BootstrapContext?.ToString()
57+ // && UserContext.Current.UserName != "admin666"
58+ // ))
59+ // {
60+ // Console.Write($"IsAuthenticated:{context.HttpContext.User.Identity.IsAuthenticated}," +
61+ // $"userToken{UserContext.Current.Token}" +
62+ // $"BootstrapContext:{((ClaimsIdentity)context.HttpContext.User.Identity)?.BootstrapContext?.ToString()}");
63+ // context.Unauthorized("登陆已过期");
64+ // return;
65+ // }
6666
6767 DateTime expDate = context . HttpContext . User . Claims . Where ( x => x . Type == JwtRegisteredClaimNames . Exp )
6868 . Select ( x => x . Value ) . FirstOrDefault ( ) . GetTimeSpmpToDate ( ) ;
You can’t perform that action at this time.
0 commit comments