修复统计图
Build and publish Jiaowu packages and container image / Test, package and publish (push) Successful in 34m39s

This commit is contained in:
2026-07-29 11:50:15 +08:00 Unverified
parent 66622ca207
commit 7bcfa1a7a4
2 changed files with 64 additions and 3 deletions
@@ -25,7 +25,12 @@ public sealed class StatisticsController(
SystemRoles.CollegeAdmin + "," +
SystemRoles.Leader;
private Guid? RestrictedCollegeId => currentUserDataScope.Current.RestrictedCollegeId;
// HybridCache may execute its source factory without the request's ambient
// HttpContext. Keep the authorization scope stable for the whole controller
// invocation instead of resolving it again inside that background factory.
private readonly CurrentUserScope currentUser = currentUserDataScope.Current;
private Guid? RestrictedCollegeId => currentUser.RestrictedCollegeId;
private Guid? ResolveCollegeId(Guid? requestedCollegeId)
{
@@ -982,7 +987,7 @@ public sealed class StatisticsController(
params string?[] filters) =>
AppCacheKeys.Statistics(
area,
currentUserDataScope.Current.Scope.ToString(),
currentUser.Scope.ToString(),
effectiveCollegeId,
filters);