Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
cloud-backend
Commits
81ff61d0
Commit
81ff61d0
authored
Jun 19, 2021
by
袁伟铭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.0.0
parent
d3260390
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
api-server/src/main/java/com/zq/api/controller/ApiController.java
+3
-1
No files found.
api-server/src/main/java/com/zq/api/controller/ApiController.java
View file @
81ff61d0
...
@@ -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"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment