Blazor WASM页面刷新找不到CSS或js

Blazor WASM page refresh cannot find CSS or js

我有一个 Blazor 页面,当我通过 URL 链接和菜单导航到它时,它工作正常。但是,一旦进入页面,如果我点击 Chrome 刷新按钮,我会得到一长串包含所有 CSS 和 JS 文件的 404 错误。如果我输入 URL 直接转到页面,也会发生这种情况。 Index.razor 页面加载正常。 A-tags 和 NavigationManagers 也按预期工作。 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

获取静态文件