https://www.cnblogs.com/magicalSam/p/7198420.html
/**
* 统一异常处理类 */
@ControllerAdvice
public class BaseExceptionHandler {
@ExceptionHandler(Exception.class)
@ResponseBody
public Result error(Exception e) {
e.printStackTrace();
System.out.println("调用了公共异常处理类");
return new Result(1,e.getMessage());
}
}