|
@@ -21,7 +21,7 @@ import java.util.Map;
|
|
|
* @author reghao
|
|
* @author reghao
|
|
|
* @date 2020-06-19 13:34:19
|
|
* @date 2020-06-19 13:34:19
|
|
|
*/
|
|
*/
|
|
|
-@RestController
|
|
|
|
|
|
|
+//@RestController
|
|
|
public class FilterExceptionHandler extends BasicErrorController {
|
|
public class FilterExceptionHandler extends BasicErrorController {
|
|
|
public FilterExceptionHandler() {
|
|
public FilterExceptionHandler() {
|
|
|
super(new DefaultErrorAttributes(), new ErrorProperties());
|
|
super(new DefaultErrorAttributes(), new ErrorProperties());
|
|
@@ -30,14 +30,14 @@ public class FilterExceptionHandler extends BasicErrorController {
|
|
|
@Override
|
|
@Override
|
|
|
@RequestMapping(produces = {MediaType.APPLICATION_JSON_VALUE})
|
|
@RequestMapping(produces = {MediaType.APPLICATION_JSON_VALUE})
|
|
|
public ResponseEntity<Map<String, Object>> error(HttpServletRequest request) {
|
|
public ResponseEntity<Map<String, Object>> error(HttpServletRequest request) {
|
|
|
- Map<String, Object> body = getErrorAttributes(request, isIncludeStackTrace(request, MediaType.ALL));
|
|
|
|
|
|
|
+ //Map<String, Object> body = getErrorAttributes(request, isIncludeStackTrace(request, MediaType.ALL));
|
|
|
HttpStatus status = getStatus(request);
|
|
HttpStatus status = getStatus(request);
|
|
|
|
|
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
- map.put("code",body.get("status"));
|
|
|
|
|
|
|
+ /*map.put("code",body.get("status"));
|
|
|
map.put("msg",body.get("message"));
|
|
map.put("msg",body.get("message"));
|
|
|
map.put("timestamp", DateTimeConverter.format(System.currentTimeMillis()));
|
|
map.put("timestamp", DateTimeConverter.format(System.currentTimeMillis()));
|
|
|
- map.put("data",body.get("data"));
|
|
|
|
|
|
|
+ map.put("data",body.get("data"));*/
|
|
|
return ResponseEntity.status(status).body(map);
|
|
return ResponseEntity.status(status).body(map);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|