if (!Yii::$app->user->isGuest)您只需要( Yii2)之类的东西asp.net core。我需要知道用户是否登录。
试过System.Security.Claims.User.Identity.IsAuthenticated了,但它一直在false
,所以错误是:HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
if (!Yii::$app->user->isGuest)您只需要( Yii2)之类的东西asp.net core。我需要知道用户是否登录。
试过System.Security.Claims.User.Identity.IsAuthenticated了,但它一直在false
,所以错误是:HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value;
回答: