1
zhang
2 天以前 8a86f58f588a6fdcbadb8750fd50b8fc7227ccb7
zy-acs-manager/src/main/java/com/zy/acs/manager/common/exception/GlobalExceptionHandler.java
@@ -1,9 +1,9 @@
package com.zy.acs.manager.common.exception;
import com.zy.acs.framework.common.R;
import com.zy.acs.framework.exception.CoolException;
import com.zy.acs.manager.common.constant.Constants;
import com.zy.acs.manager.common.utils.CommonUtil;
import com.zy.acs.framework.common.R;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
@@ -51,7 +51,10 @@
    @ExceptionHandler(CoolException.class)
    public R coolExceptionHandler(CoolException e, HttpServletResponse response) {
        CommonUtil.addCrossHeaders(response);
        return R.error(e.getMessage());
        if (e.getCode() == null) {
            return R.error(e.getMessage());
        }
        return R.error(e.getCode(), e.getMessage());
    }
    @ResponseBody