Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
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
chenjunxiong
guns-vip
Commits
5d35d690
Commit
5d35d690
authored
May 16, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日志记录改为先执行业务,在记录日志
parent
ff45adbb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
src/main/java/com/stylefeng/guns/core/aop/LogAop.java
+16
-5
No files found.
src/main/java/com/stylefeng/guns/core/aop/LogAop.java
View file @
5d35d690
...
...
@@ -42,6 +42,19 @@ public class LogAop {
@Around
(
"cutService()"
)
public
Object
recordSysLog
(
ProceedingJoinPoint
point
)
throws
Throwable
{
//先执行业务
Object
result
=
point
.
proceed
();
try
{
handle
(
point
);
}
catch
(
Exception
e
)
{
log
.
error
(
"日志记录出错!"
,
e
);
}
return
result
;
}
private
void
handle
(
ProceedingJoinPoint
point
)
throws
Exception
{
//获取拦截的方法名
Signature
sig
=
point
.
getSignature
();
MethodSignature
msig
=
null
;
...
...
@@ -56,7 +69,7 @@ public class LogAop {
//如果当前用户未登录,不做日志
ShiroUser
user
=
ShiroKit
.
getUser
();
if
(
null
==
user
)
{
return
point
.
proceed
()
;
return
;
}
//获取拦截方法的参数
...
...
@@ -84,15 +97,14 @@ public class LogAop {
}
else
{
Map
<
String
,
String
>
parameters
=
HttpKit
.
getRequestParameters
();
String
value
=
parameters
.
get
(
key
);
if
(
ToolUtil
.
isNotEmpty
(
value
))
{
if
(
ToolUtil
.
isNotEmpty
(
value
))
{
AbstractDictMap
dictMap
=
DictMapFactory
.
createDictMap
(
dictClass
);
msg
=
dictMap
.
get
(
key
)
+
":"
+
value
;
}
else
{
}
else
{
msg
=
"无"
;
}
}
LogManager
.
me
().
executeLog
(
LogTaskFactory
.
bussinessLog
(
user
.
getId
(),
bussinessName
,
className
,
methodName
,
msg
));
return
point
.
proceed
();
}
}
\ No newline at end of file
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