调试版正常, 发布版访问时出现 "您没有访问该页面的权限" 错误, 但同样设置的其他10几个页面都正常. 异常如下 :
Microsoft.AspNetCore.Hosting.Diagnostics[1]Request starting HTTP/2 GET https://localhost:5001/TestJobItem/Index?v=1.2.1
info: Microsoft.AspNetCore.ResponseCaching.ResponseCachingMiddleware[24]No cached response available for this request.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]Executing endpoint 'ProjectIt.Controllers.TestJobItemController.Index (ProjectIt)'
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3]Route matched with {action = "Index", controller = "TestJobItem", area = ""}. Executing controller action with signature Microsoft.AspNetCore.Mvc.ActionResult Index(System.Nullable`1[System.Guid]) on controller ProjectIt.Controllers.TestJobItemController (ProjectIt).
info: WalkingTec.Mvvm.Core.Auth.WTMAuthorizationService[1]Authorization was successful.
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[2]Executed action ProjectIt.Controllers.TestJobItemController.Index (ProjectIt) in 30.5799ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]Executed endpoint 'ProjectIt.Controllers.TestJobItemController.Index (ProjectIt)'
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]An unhandled exception has occurred while executing the request.
System.Exception: 您没有访问该页面的权限
at WalkingTec.Mvvm.Mvc.Filters.PrivilegeFilter.OnActionExecuting(ActionExecutingContext context)
at Microsoft.AspNetCore.Mvc.Filters.ActionFilterAttribute.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at WalkingTec.Mvvm.Mvc.FrameworkServiceExtension.<>c__DisplayClass1_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.ResponseCaching.ResponseCachingMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
info: Microsoft.AspNetCore.ResponseCaching.ResponseCachingMiddleware[24]No cached response available for this request.
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]Executing endpoint 'WalkingTec.Mvvm.Mvc._FrameworkController.Error (WalkingTec.Mvvm.Mvc)'
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[3]Route matched with {action = "Error", controller = "_Framework", area = ""}. Executing controller action with signature Microsoft.AspNetCore.Mvc.IActionResult Error() on controller WalkingTec.Mvvm.Mvc._FrameworkController (WalkingTec.Mvvm.Mvc).
info: Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor[1]Executing ObjectResult, writing value of type 'System.String'.
info: Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker[2]Executed action WalkingTec.Mvvm.Mvc._FrameworkController.Error (WalkingTec.Mvvm.Mvc) in 24.1513ms
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]Executed endpoint 'WalkingTec.Mvvm.Mvc._FrameworkController.Error (WalkingTec.Mvvm.Mvc)'
info: Microsoft.AspNetCore.ResponseCaching.ResponseCachingMiddleware[27]The response could not be cached for this request.
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]Request finished in 191.8911ms 400 text/plain; charset=utf-8