StartUp.Configure
app.UseMvc(routes =>
{
routes.MapRoute(
name: "Admin",
template: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
配置 name: "default"那个就好了吧?
@PER10: 看楼上发的图,改最后一句里的Home,和Index;也就是改默认控制器和默认起始页
等等大哥,我这个项目是Razor Pages!