Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
head_group
xyqb-user2
Commits
b11614a3
Commit
b11614a3
authored
Jun 15, 2017
by
Java—红包—徐 然
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into feature/usercatch
parents
cc5bce1a
47e4eb2b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
7 deletions
+17
-7
IBaseController.java
...n/java/cn/quantgroup/xyqb/controller/IBaseController.java
+10
-0
PlatformAPIController.java
...b/controller/internal/platform/PlatformAPIController.java
+1
-1
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+3
-3
UserDetailController.java
...p/xyqb/controller/internal/user/UserDetailController.java
+1
-1
RequestFilter.java
src/main/java/cn/quantgroup/xyqb/filter/RequestFilter.java
+2
-2
No files found.
src/main/java/cn/quantgroup/xyqb/controller/IBaseController.java
View file @
b11614a3
...
...
@@ -15,6 +15,7 @@ import static cn.quantgroup.xyqb.session.XyqbSessionContextHolder.getXSessionFro
*/
public
interface
IBaseController
{
@Deprecated
default
User
getCurrentUser
()
{
SessionStruct
session
=
getXSession
();
if
(
session
==
null
)
{
...
...
@@ -23,10 +24,19 @@ public interface IBaseController {
return
getXSession
().
getValues
().
getUser
();
}
@Deprecated
default
SessionStruct
getSessionStruct
()
{
return
getXSession
();
}
default
User
getCurrentUserFromRedis
()
{
SessionStruct
session
=
getXSessionFromRedis
();
if
(
session
==
null
)
{
return
null
;
}
return
session
.
getValues
().
getUser
();
}
default
SessionStruct
getCurrentSessionFromRedis
(){
return
getXSessionFromRedis
();
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/platform/PlatformAPIController.java
View file @
b11614a3
...
...
@@ -47,7 +47,7 @@ public class PlatformAPIController implements IBaseController {
@RequestMapping
(
"/page/next"
)
public
JsonResult
nextPage
(
String
key
,
String
target
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
currentPage
)
{
User
user
=
getCurrentUser
();
User
user
=
getCurrentUser
FromRedis
();
if
(
null
==
user
)
{
return
JsonResult
.
buildErrorStateResult
(
"未找到用户"
,
null
);
}
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
b11614a3
...
...
@@ -88,7 +88,7 @@ public class UserController implements IBaseController {
@RequestMapping
(
"/test"
)
public
JsonResult
test
()
{
return
JsonResult
.
buildSuccessResult
(
""
,
getCurrentUser
());
return
JsonResult
.
buildSuccessResult
(
""
,
getCurrentUser
FromRedis
());
}
@RequestMapping
(
"/login/fast"
)
...
...
@@ -368,7 +368,7 @@ public class UserController implements IBaseController {
@RequestMapping
(
"/syncUserInfo"
)
public
JsonResult
syncUserInfo
()
{
User
user
=
getCurrentUser
();
User
user
=
getCurrentUser
FromRedis
();
if
(
null
==
user
)
{
return
JsonResult
.
buildErrorStateResult
(
null
,
null
);
}
...
...
@@ -450,7 +450,7 @@ public class UserController implements IBaseController {
@RequestMapping
(
"/associate_wechat"
)
public
JsonResult
associateWithWechat
(
String
openId
)
{
User
user
=
getCurrentUser
();
User
user
=
getCurrentUser
FromRedis
();
Long
userId
=
user
.
getId
();
WechatUserInfo
userInfo
=
wechatService
.
findWechatUserInfoFromDb
(
openId
);
LOGGER
.
info
(
"微信关联openId,user:[{}],openId:[{}],wechatUserInfo:[{}]"
,
user
,
openId
,
userInfo
);
...
...
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserDetailController.java
View file @
b11614a3
...
...
@@ -42,7 +42,7 @@ public class UserDetailController implements IBaseController {
if
(!
info
.
isValid
())
{
return
JsonResult
.
buildErrorStateResult
(
"身份证号码错误"
,
null
);
}
User
user
=
getCurrentUser
();
User
user
=
getCurrentUser
FromRedis
();
if
(
user
==
null
)
{
return
JsonResult
.
buildErrorStateResult
(
"系统错误"
,
null
);
}
...
...
src/main/java/cn/quantgroup/xyqb/filter/RequestFilter.java
View file @
b11614a3
...
...
@@ -49,7 +49,7 @@ public class RequestFilter implements Filter {
SessionStruct
sessionStruct
;
if
(!
isMatch
(
requestPath
))
{
//获取session信息,如果没有获取到session信息则返回错误信息
sessionStruct
=
XyqbSessionContextHolder
.
getXSession
();
sessionStruct
=
XyqbSessionContextHolder
.
getXSession
FromRedis
();
if
(
sessionStruct
==
null
)
{
response
.
setStatus
(
401
);
response
.
setHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
...
...
@@ -61,7 +61,7 @@ public class RequestFilter implements Filter {
try
{
filterChain
.
doFilter
(
request
,
response
);
}
finally
{
sessionStruct
=
XyqbSessionContextHolder
.
getXSession
();
sessionStruct
=
XyqbSessionContextHolder
.
getXSession
FromRedis
();
if
(
sessionStruct
!=
null
)
{
try
{
sessionService
.
persistSession
(
sessionStruct
.
getSid
(),
sessionStruct
.
getValues
());
...
...
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