我有一个Blazor页面,当我通过URL链接和菜单导航到它时,它运行良好。然而,一旦进入页面,如果我点击Chrome刷新按钮,我会收到一长串404个错误,其中包括我所包含的所有CSS和JS文件。如果我键入URL以直接转到页面,也会发生这种情况。Index.razor页面加载良好。A-tags和NavigationManager也按预期工作。URL是";https://localhost:5001/OrderEdit/223821"其中OrderEdit是页面名称,后跟订单号。页面指令看起来像这个
@page "/OrderEdit"
@page "/OrderEdit/{OrderNumStr}"
当我刷新页面时,我会得到这个(为简洁起见,请缩短(
GET https://localhost:5001/OrderEdit/bootstrap/css/bootstrap.min.css?v=1 net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/css/Chart.min.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/css/app.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/css/site.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/bootstrap/css/custom.css?v=1 net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/Blazorise/blazorise.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/Blazorise.Bootstrap/blazorise.bootstrap.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/AntDesign/css/ant-design-blazor.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/Blazored.Typeahead/blazored-typeahead.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/BlazorDateRangePicker/daterangepicker.min.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_content/Sotsera.Blazor.Toaster/toastr.min.css net::ERR_ABORTED 404
GET https://localhost:5001/OrderEdit/_framework/blazor.webassembly.js net::ERR_ABORTED 404
您的index.html头中有<base href="/" />
吗?它看起来不是-因为它试图从/OrderEdit 获取静态文件