@@ -238,9 +238,7 @@ namespace YhCore.WebApi
|
||||
var user = context.User;
|
||||
if (user?.Identity?.IsAuthenticated != true)
|
||||
{
|
||||
context.Response.StatusCode = 401;
|
||||
await context.Response.WriteAsync("未登录(SSO 未开启或 Cookie 失效)");
|
||||
return;
|
||||
throw new DException("未登录(SSO 未开启或 Cookie 失效)");
|
||||
}
|
||||
var name = user.Identity?.Name ?? "-";
|
||||
var id = user.FindFirst(System.Security.Claims.ClaimTypes.NameIdentifier)?.Value ?? "-";
|
||||
|
||||
Reference in New Issue
Block a user