base href换成如下script标签
<!-- <base href="/"> --> <script> document.write(‘<base href="‘ + document.location + ‘" />‘); </script>
在app.module.ts下添加 { provide: LocationStrategy, useClass: HashLocationStrategy }
providers: [ HttpErrorHandler, httpInterceptorProviders, CookieService, { provide: NZ_I18N, useValue: zh_CN }, { provide: RequestCache, useClass: RequestCacheWithMap }, { provide: RouteReuseStrategy, useClass: CustomReuseStrategy }, { provide: LocationStrategy, useClass: HashLocationStrategy } ]
搞定!
原文地址:https://www.cnblogs.com/sooooogiotto/p/10556691.html
时间: 2024-10-05 06:34:38