项目中经常遇到的异常情况 400-Bad Request 401-Unauthorized If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. 403-Forbidden The server understood the request, but i…
(1)自定义异常处理&返回定制Json数据 @ControllerAdvice public class MyExceptionHandler { @ResponseBody @ExceptionHandler(UserNotExistException.class) public Map<String,Object> handleException(Exception e){ Map<String,Object> map = new HashMap<>();…