springboot angular前后端分离部署时,正常路径刷新后报404的解决办法

935 阅读1分钟
@Component
public class WebConfig implements ErrorPageRegistrar{


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


}