我有一个使用ASPnet Module Zero框架构建的ASP.net MVC应用程序。由于某些原因,即使我已经登录,所有页面URL似乎都带有/ Account / Login前缀。例如,登录页面的URL为:
localhost:62114/Account/Login/Account/Login
登录后,一个应用程序页面是
localhost:62114/Account/Login/App/ListAllAccount
尝试访问URL中没有/ Account / Login的任何页面都会自动导致错误404。appsettings.json如下所示:
"App": {
"WebSiteRootAddress": "http://localhost:62114/",
"CorsOrigins": "http://localhost:62114"
},
路由配置如下:
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
routes.MapRoute(
name: "defaultWithArea",
template: "{area}/{controller=Home}/{action=Index}/{id?}");
所有服务和资源也使用正确的URL,这意味着您实际上无法登录,因为您无法访问服务URL。
编辑:我现在注意到的一件事是,仅当我在本地调试应用程序时。一旦发布,问题似乎就消失了。