| 12345678910111213141516 |
- package com.ctsi.handler;
- import com.ctsi.utils.ApiResult;
- import org.springframework.web.bind.annotation.ExceptionHandler;
- import org.springframework.web.bind.annotation.RestControllerAdvice;
- @RestControllerAdvice
- public class GlobalExceptionHandler {
- // 全局异常拦截
- @ExceptionHandler
- public ApiResult handlerException(Exception e) {
- e.printStackTrace();
- return ApiResult.result(401, e.getMessage(), null);
- }
- }
|