spring自带404页面(没法用)
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Jan 07 13:52:29 CST 2021
There was an unexpected error (type=Not Found, status=404).
No message available
只要实现ErrorController接口即可
@Slf4j
@ApiIgnore
@RestController
@RequestMapping("${server.error.path:${error.path:/error}}")
public class ErroControllerConfig implements ErrorController {
public static final String PATH = "/erro";
@Override
public String getErrorPath() {
return PATH;
}
@RequestMapping
public R doHandleError() {
return R.error(404,"对不起,我迷路了");
}
}