孙永军 преди 1 година
родител
ревизия
7e34e203a5
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/main/java/com/smcic/core/advice/APIResponseAdvice.java

+ 1 - 1
src/main/java/com/smcic/core/advice/APIResponseAdvice.java

@@ -33,7 +33,7 @@ public class APIResponseAdvice implements ResponseBodyAdvice<Object> {
         apiNoDataResponse.setCode(ex.getErrorCode());
         apiNoDataResponse.setMessage(ex.getErrorMessage());
 
-        response.setStatus(HttpStatus.INTERNAL_SERVER_ERROR.value());
+        response.setStatus(ex.getErrorCode() == -1 ? HttpStatus.INTERNAL_SERVER_ERROR.value() : HttpStatus.OK.value());
         return apiNoDataResponse;
     }