Ich benutze ASP NET Core + Identity. Wenn ich nicht berechtigt bin, auf eine Seite zuzugreifen, habe ich Folgendes bekommen:ASP NET-Core-Identität. ReturnUrl
http://localhost:5087/Login?ReturnUrl=/Error/401
Wie soll ich ReturnUrl richtig bekommen?
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseExceptionHandler("/Error");
app.UseStatusCodePagesWithReExecute("/Error/{0}");
app.UseStaticFiles();
app.UseIdentity();
app.UseMvc();
}
public IActionResult Error(string id)
{
switch(id)
{
case "404":
return File("~/errors/404.html", "text/html");
break;
}
}
Haben Sie erwartet: 'http: // localhost: 5087/Error/401'? – Marusyk
@MegaTron Ich erwarte http: // localhost: 5087/Login? ReturnUrl = RequestedAction – dizar47