解决方法1:

app.module.ts文件添加两行代码:

import { LocationStrategy, HashLocationStrategy } from '@angular/common';
    @NgModule({
     
        providers: [
     
        { provide: LocationStrategy, useClass: HashLocationStrategy },
     
        ]
     
    })

解决方法2:

在springboot项目application中添加

    @Component
    public class WebConfig implements ErrorPageRegistrar {


        @Override
        public void registerErrorPages(ErrorPageRegistry registry) {
            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/");
            registry.addErrorPages(error404Page);
        }


    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-06
  • 2021-08-26
  • 2021-07-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-25
  • 2021-11-27
  • 2021-12-15
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
相关资源
相似解决方案