自动化立体仓库 - WMS系统
zyx
2023-07-14 525cf3d9714352284b70c29f81fa73bff71cf683
src/main/java/com/zy/common/config/CoolExceptionHandler.java
@@ -2,7 +2,6 @@
import com.core.common.R;
import com.core.exception.CoolException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.method.HandlerMethod;
@@ -26,7 +25,13 @@
    @ExceptionHandler(CoolException.class)
    public R handleRRException(CoolException e) {
        return R.parse(e.getMessage());
        String[] split = e.getMessage().split("-");
        if (split.length == 2) {
            if (String.valueOf(split[0]).length() < 3) {
                return R.parse(e.getMessage());
            }
        }
        return R.error(e.getMessage());
    }
}