我将 url 保存在数据库中,并且各个用户都映射到 url
URL: ~/user
从应用程序,我检查通过
bool isAuthorized = DBHelper.IsAuthorized(
string.Concat("~" , Url.Action("Index", "User"),
httpContext.User.Identity.Name);
它在开发环境中运行良好。但是在生产中,应用程序是在 IIS 应用程序ucms下配置的,因此 Url.Action("Index", "User") 返回,/ucms/user
因此isAuthorized
返回 false。
任何人都可以就为解决这种行为而进行的更改提供任何意见或方向。