//当返回404代码的时候定向到登录页面
app.UseStatusCodePages(
async options =>{if (options.HttpContext.Response.StatusCode == 404)
{
options.HttpContext.Response.Redirect("/Acount/Login");
} }
);