Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspect
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
912协同工作系统
项目监控管理工具
inspect
Commits
cbe582a1
提交
cbe582a1
authored
4月 16, 2020
作者:
马晨俊
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
mcj:user非空判断
上级
e26c2cb3
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
16 行增加
和
14 行删除
+16
-14
AopIntercept.java
src/main/java/com/zjty/inspect/aop/AopIntercept.java
+16
-14
没有找到文件。
src/main/java/com/zjty/inspect/aop/AopIntercept.java
浏览文件 @
cbe582a1
...
@@ -44,20 +44,22 @@ public class AopIntercept {
...
@@ -44,20 +44,22 @@ public class AopIntercept {
public
Object
aroundMethod
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
public
Object
aroundMethod
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
AuthAnnotation
authAnnotation
=
((
MethodSignature
)
joinPoint
.
getSignature
()).
getMethod
().
getAnnotation
(
AuthAnnotation
.
class
);
AuthAnnotation
authAnnotation
=
((
MethodSignature
)
joinPoint
.
getSignature
()).
getMethod
().
getAnnotation
(
AuthAnnotation
.
class
);
String
[]
code
=
authAnnotation
.
code
();
String
[]
code
=
authAnnotation
.
code
();
List
<
String
>
authorityCode
=
user
.
getAuthorityCode
();
if
(
user
!=
null
){
for
(
String
s
:
code
)
{
List
<
String
>
authorityCode
=
user
.
getAuthorityCode
();
if
(
authorityCode
.
contains
(
s
))
{
for
(
String
s
:
code
)
{
long
startMillis
=
System
.
currentTimeMillis
();
if
(
authorityCode
.
contains
(
s
))
{
Object
proceed
=
joinPoint
.
proceed
();
long
startMillis
=
System
.
currentTimeMillis
();
long
endMillis
=
System
.
currentTimeMillis
();
Object
proceed
=
joinPoint
.
proceed
();
long
time
=
(
endMillis
-
startMillis
);
long
endMillis
=
System
.
currentTimeMillis
();
log
.
info
(
"评估总耗时{}毫秒"
,
time
);
long
time
=
(
endMillis
-
startMillis
);
log
.
info
(
"PersonAspect2 ==> before method : {}"
,
joinPoint
.
getSignature
().
getName
());
log
.
info
(
"评估总耗时{}毫秒"
,
time
);
log
.
info
(
"注解的类型名称为{}"
,
joinPoint
.
getSignature
().
getDeclaringTypeName
());
log
.
info
(
"PersonAspect2 ==> before method : {}"
,
joinPoint
.
getSignature
().
getName
());
log
.
info
(
"方法修饰符个数为{}"
,
joinPoint
.
getSignature
().
getModifiers
());
log
.
info
(
"注解的类型名称为{}"
,
joinPoint
.
getSignature
().
getDeclaringTypeName
());
log
.
info
(
"方法名称为{}"
,
joinPoint
.
getSignature
().
getName
());
log
.
info
(
"方法修饰符个数为{}"
,
joinPoint
.
getSignature
().
getModifiers
());
log
.
info
(
"方法参数{}"
,
joinPoint
.
getArgs
());
log
.
info
(
"方法名称为{}"
,
joinPoint
.
getSignature
().
getName
());
return
proceed
;
log
.
info
(
"方法参数{}"
,
joinPoint
.
getArgs
());
return
proceed
;
}
}
}
}
}
return
ResponseEntity
.
status
(
403
).
build
();
return
ResponseEntity
.
status
(
403
).
build
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论