1
build / build-push (push) Successful in 35s

This commit is contained in:
wanghu
2026-09-03 16:51:51 +08:00
parent c8632e25c2
commit ce5e806adb
2 changed files with 6 additions and 8 deletions
+1 -3
View File
@@ -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 ?? "-";