Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 553f9f9c
由
孙克
编写于
2023-08-15 15:09:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
API返回值获取判断修改
API地址修改
1 个父辈
17b48921
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
15 行增加
和
4 行删除
src/main/java/com/neotel/smfcore/common/exception/handler/GlobalExceptionHandler.java
src/main/java/com/neotel/smfcore/custom/micron1053/bean/MicronResult.java
src/main/java/com/neotel/smfcore/security/TokenFilter.java
src/main/resources/config/application-prod.yml
src/main/java/com/neotel/smfcore/common/exception/handler/GlobalExceptionHandler.java
查看文件 @
553f9f9
...
...
@@ -7,6 +7,7 @@ import com.neotel.smfcore.common.utils.ThrowableUtil;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.catalina.connector.ClientAbortException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
...
...
@@ -41,6 +42,16 @@ public class GlobalExceptionHandler {
/**
* BadCredentialsException
*/
@ExceptionHandler
(
ClientAbortException
.
class
)
public
ResponseEntity
<
ApiError
>
clientAbortException
(
ClientAbortException
e
){
// 打印堆栈信息
log
.
warn
(
e
.
getMessage
());
return
buildResponseEntity
(
ApiError
.
error
(
e
.
getMessage
()));
}
/**
* BadCredentialsException
*/
@ExceptionHandler
(
BadCredentialsException
.
class
)
public
ResponseEntity
<
ApiError
>
badCredentialsException
(
BadCredentialsException
e
){
// 打印堆栈信息
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/bean/MicronResult.java
查看文件 @
553f9f9
...
...
@@ -28,7 +28,7 @@ public class MicronResult implements Serializable {
private
String
responseData
;
public
boolean
isSuccess
()
{
if
(
ObjectUtil
.
isNotEmpty
(
status
)
&&
status
.
equals
(
"Success"
))
{
if
(
ObjectUtil
.
isNotEmpty
(
status
)
&&
status
.
equals
IgnoreCase
(
"Success"
))
{
return
true
;
}
return
false
;
...
...
@@ -52,7 +52,7 @@ public class MicronResult implements Serializable {
}
Object
resultStatus
=
resultMap
.
get
(
"status"
);
if
(
resultStatus
!=
null
&&
!
resultStatus
.
toString
().
equalsIgnoreCase
(
"SUCCESS
S
"
))
{
if
(
resultStatus
!=
null
&&
!
resultStatus
.
toString
().
equalsIgnoreCase
(
"SUCCESS"
))
{
Object
msgObj
=
resultMap
.
get
(
"message"
)
;
if
(
ObjectUtil
.
isEmpty
(
msgObj
)){
throw
new
ApiException
(
"smfcore.api.error"
,
"status="
+
resultStatus
);
...
...
src/main/java/com/neotel/smfcore/security/TokenFilter.java
查看文件 @
553f9f9
...
...
@@ -67,7 +67,7 @@ public class TokenFilter extends GenericFilterBean {
try
{
onlineUserDto
=
onlineUserService
.
getOne
(
properties
.
getOnlineKey
()
+
token
);
}
catch
(
ExpiredJwtException
e
)
{
log
.
error
(
e
.
getMessage
());
//
log.error(e.getMessage());
}
if
(
onlineUserDto
!=
null
&&
StringUtils
.
hasText
(
token
))
{
Authentication
authentication
=
tokenProvider
.
getAuthentication
(
token
);
...
...
src/main/resources/config/application-prod.yml
查看文件 @
553f9f9
micron
:
apiAddr
:
http
s://testapigtwy.micron.com/t/app.mfg/mmsil/v1/DEVL/SINGAPORE
/
apiAddr
:
http
://istio-ingressgateway-istio-system.apps.ose-dev45.micron.com
/
api_name_001
:
material/validation/label
api_name_002
:
material/transfer-in
api_name_004
:
operation/dispatchIds?operationId={0}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论