Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
sts网站
Commits
a46e5460
Commit
a46e5460
authored
Nov 19, 2019
by
RuoYi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志记录过滤特殊对象,防止转换异常
parent
5d4b0e6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
LogAspect.java
.../src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
+14
-1
No files found.
ruoyi/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
View file @
a46e5460
...
@@ -2,6 +2,8 @@ package com.ruoyi.framework.aspectj;
...
@@ -2,6 +2,8 @@ package com.ruoyi.framework.aspectj;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.util.Map
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.annotation.AfterReturning
;
import
org.aspectj.lang.annotation.AfterReturning
;
...
@@ -192,7 +194,7 @@ public class LogAspect
...
@@ -192,7 +194,7 @@ public class LogAspect
{
{
for
(
int
i
=
0
;
i
<
paramsArray
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
paramsArray
.
length
;
i
++)
{
{
if
(!
(
paramsArray
[
i
]
instanceof
MultipartFile
))
if
(!
isFilterObject
(
paramsArray
[
i
]
))
{
{
Object
jsonObj
=
JSON
.
toJSON
(
paramsArray
[
i
]);
Object
jsonObj
=
JSON
.
toJSON
(
paramsArray
[
i
]);
params
+=
jsonObj
.
toString
()
+
" "
;
params
+=
jsonObj
.
toString
()
+
" "
;
...
@@ -201,4 +203,15 @@ public class LogAspect
...
@@ -201,4 +203,15 @@ public class LogAspect
}
}
return
params
.
trim
();
return
params
.
trim
();
}
}
/**
* 判断是否需要过滤的对象。
*
* @param o 对象信息。
* @return 如果是需要过滤的对象,则返回true;否则返回false。
*/
public
boolean
isFilterObject
(
final
Object
o
)
{
return
o
instanceof
MultipartFile
||
o
instanceof
HttpServletRequest
||
o
instanceof
HttpServletResponse
;
}
}
}
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