Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Apr 28 21:59:19 CST 2022
There was an unexpected error (type=Not Found, status=404).
No message available
解决方法: 配置错误异常页面处理
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
/**
* 错误页面处理类
*/
@Component
public class ErrorConfig implements ErrorPageRegistrar {
/**
* 404页面错误处理方法,重定向至index.html页面
* @param registry
*/
@Override
public void registerErrorPages(ErrorPageRegistry registry) {
ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/index.html");
registry.addErrorPages(error404Page);
}
}