错误信息:
HTTP Status 404 – Not Found
Type Status Report
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/8.5.40

解决方法----开启 Hash 模式
在app.module.ts中
1.导入 HashLocationStrategy 及 HashLocationStrategy
import

当Angular6应用在刷新页面时遇到HTTP 404错误,可以尝试通过启用HashLocationStrategy来解决。具体操作包括在app.module.ts文件中导入HashLocationStrategy,并在NgModule的providers中进行配置。
最低0.47元/天 解锁文章
5542

被折叠的 条评论
为什么被折叠?



