Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
93fd97cc
Commit
93fd97cc
authored
May 13, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加对Android的支持
parent
3b5a7ee8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
WebAspect.java
...ud/src/main/java/com/yanzuoguang/cloud/aop/WebAspect.java
+18
-2
TokenHelper.java
...l-db/src/main/java/com/yanzuoguang/token/TokenHelper.java
+1
-1
No files found.
yzg-util-cloud/src/main/java/com/yanzuoguang/cloud/aop/WebAspect.java
View file @
93fd97cc
...
@@ -9,6 +9,7 @@ import com.yanzuoguang.util.helper.JsonHelper;
...
@@ -9,6 +9,7 @@ import com.yanzuoguang.util.helper.JsonHelper;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
import
com.yanzuoguang.util.log.Log
;
import
com.yanzuoguang.util.log.Log
;
import
com.yanzuoguang.util.vo.LogVo
;
import
com.yanzuoguang.util.vo.LogVo
;
import
com.yanzuoguang.util.vo.Ref
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
com.yanzuoguang.util.vo.ResponseResult
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.Signature
;
...
@@ -61,6 +62,7 @@ public class WebAspect extends BaseRequestAspect {
...
@@ -61,6 +62,7 @@ public class WebAspect extends BaseRequestAspect {
ResponseResult
responseResult
=
null
;
ResponseResult
responseResult
=
null
;
long
start
=
System
.
currentTimeMillis
();
long
start
=
System
.
currentTimeMillis
();
String
name
=
joinPoint
.
getSignature
().
getName
();
String
name
=
joinPoint
.
getSignature
().
getName
();
Ref
<
Boolean
>
flag
=
new
Ref
<>(
false
);
try
{
try
{
logger
.
info
(
"[ {} ] request params is {}"
,
name
,
joinPoint
.
getArgs
());
logger
.
info
(
"[ {} ] request params is {}"
,
name
,
joinPoint
.
getArgs
());
tokenServiceCall
.
tokenInit
();
tokenServiceCall
.
tokenInit
();
...
@@ -74,7 +76,7 @@ public class WebAspect extends BaseRequestAspect {
...
@@ -74,7 +76,7 @@ public class WebAspect extends BaseRequestAspect {
long
end
=
System
.
currentTimeMillis
();
long
end
=
System
.
currentTimeMillis
();
logger
.
info
(
"[ {} ] time ({})ms, result is {}"
,
name
,
(
end
-
start
),
responseResult
);
logger
.
info
(
"[ {} ] time ({})ms, result is {}"
,
name
,
(
end
-
start
),
responseResult
);
tokenFinish
(
flag
);
return
result
;
return
result
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
long
end
=
System
.
currentTimeMillis
();
long
end
=
System
.
currentTimeMillis
();
...
@@ -86,12 +88,26 @@ public class WebAspect extends BaseRequestAspect {
...
@@ -86,12 +88,26 @@ public class WebAspect extends BaseRequestAspect {
throw
e
;
throw
e
;
}
}
}
finally
{
}
finally
{
token
ServiceCall
.
tokenFinish
(
);
token
Finish
(
flag
);
Log
.
threadCommit
();
Log
.
threadCommit
();
saveInterLogs
(
joinPoint
,
responseResult
);
saveInterLogs
(
joinPoint
,
responseResult
);
}
}
}
}
/**
* 执行结束函数
*
* @param flag 结束函数
* @return 结束函数
*/
private
void
tokenFinish
(
Ref
<
Boolean
>
flag
)
{
if
(
flag
.
value
==
true
)
{
return
;
}
flag
.
value
=
true
;
tokenServiceCall
.
tokenFinish
();
}
/**
/**
* 获取返回的至类型
* 获取返回的至类型
*
*
...
...
yzg-util-db/src/main/java/com/yanzuoguang/token/TokenHelper.java
View file @
93fd97cc
...
@@ -86,7 +86,7 @@ public class TokenHelper {
...
@@ -86,7 +86,7 @@ public class TokenHelper {
cache
.
put
(
id
,
tokenData
);
cache
.
put
(
id
,
tokenData
);
}
}
}
}
if
(
tokenData
.
getData
()
==
null
)
{
if
(
tokenData
==
null
||
tokenData
.
getData
()
==
null
)
{
if
(
checkFlag
)
{
if
(
checkFlag
)
{
throw
new
CodeException
(
"请先登录"
);
throw
new
CodeException
(
"请先登录"
);
}
}
...
...
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