Commit 81ff61d0 by 袁伟铭

1.0.0

parent d3260390
...@@ -16,6 +16,7 @@ import com.zq.common.vo.ResultVo; ...@@ -16,6 +16,7 @@ import com.zq.common.vo.ResultVo;
import feign.FeignException; import feign.FeignException;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -23,6 +24,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -23,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
import java.util.Arrays; import java.util.Arrays;
@Api(tags = "API接口") @Api(tags = "API接口")
@Slf4j
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api") @RequestMapping("/api")
...@@ -84,8 +86,8 @@ public class ApiController { ...@@ -84,8 +86,8 @@ public class ApiController {
try { try {
resp = apiService.action(form); resp = apiService.action(form);
} catch (Exception e) { } catch (Exception e) {
log.error("调用方法异常:{}", e.getMessage());
stackTrace = ThrowableUtil.getStackTrace(e); stackTrace = ThrowableUtil.getStackTrace(e);
e.printStackTrace();
// 判断指定异常是否来自或者包含指定异常 // 判断指定异常是否来自或者包含指定异常
if (ExceptionUtil.isFromOrSuppressedThrowable(e, FeignException.Unauthorized.class)) { if (ExceptionUtil.isFromOrSuppressedThrowable(e, FeignException.Unauthorized.class)) {
resp = ApiUtils.toApiResp(form, ResultVo.fail(401, "Unauthorized")); resp = ApiUtils.toApiResp(form, ResultVo.fail(401, "Unauthorized"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment