north-glass-erp/src/main/java/com/example/erp/exception/GlobalExceptionHandle.java
@@ -9,6 +9,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; import java.util.Arrays; @ControllerAdvice public class GlobalExceptionHandle { /** @@ -23,7 +25,7 @@ @ExceptionHandler(NotPermissionException.class) @ResponseBody public Result handlerException(NotPermissionException e) { return Result.error(Constants.Code_401,"This user has no permission to access this resource"); return Result.error(Constants.Code_401,e.getPermission()); } // 拦截:未登录异常