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
360e7575
Commit
360e7575
authored
Feb 20, 2017
by
lee_mingzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加跳转商城具体页面的逻辑
parent
5d17a296
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
WeChatController.java
...group/xyqb/controller/external/user/WeChatController.java
+8
-8
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/WeChatController.java
View file @
360e7575
...
...
@@ -173,9 +173,9 @@ public class WeChatController {
* @param response
* @return
*/
@RequestMapping
(
"/receiveCode/{key}"
)
public
void
receiveCode
(
String
code
,
@PathVariable
(
value
=
"key"
)
String
systemKey
,
String
redirect
,
HttpServletResponse
response
)
{
LOGGER
.
info
(
"微信登录:
"
+
systemKey
);
@RequestMapping
(
"/receiveCode/{key}
/{redirect}
"
)
public
void
receiveCode
(
String
code
,
@PathVariable
(
value
=
"key"
)
String
systemKey
,
@PathVariable
String
redirect
,
HttpServletResponse
response
)
{
LOGGER
.
info
(
"微信登录:
redirect{}"
+
redirect
);
// 从code获取token
Merchant
merchant
=
merchantService
.
findMerchantByName
(
systemKey
);
...
...
@@ -221,15 +221,17 @@ public class WeChatController {
}
private
String
createUserSession
(
User
user
,
Merchant
merchant
,
String
redirect
)
{
if
(
StringUtils
.
isEmpty
(
redirect
))
{
LOGGER
.
info
(
"微信登录:
createUserSession:{} merchant is null:"
,
merchant
==
null
);
if
(
StringUtils
.
isEmpty
(
redirect
)
||
"redirect"
.
equals
(
redirect
)
)
{
LOGGER
.
info
(
"微信登录:
redirect为null,走正常流程."
);
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
return
loginInWechatWithSessionCreated
(
user
,
merchant
,
"cashTarget5"
,
Constants
.
Channel
.
BAITIAO
);
}
else
{
return
loginInWechatWithSessionCreated
(
user
,
merchant
,
"cashTarget4"
,
1L
);
}
}
else
if
(
redirect
.
equals
(
"redirect"
)){
}
else
if
(
redirect
.
equals
(
"local"
)){
LOGGER
.
info
(
"微信登录:redirect不为null,创建session跳到指定前端页面."
);
AuthBean
authBean
=
sessionService
.
createSession
(
Constants
.
Channel
.
WECHAT
,
Constants
.
Channel
.
WECHAT
,
""
,
user
,
merchant
);
LOGGER
.
info
(
"微信登录:跳转地址{}"
,
userUIAddr
+
"/weixin/callback?phoneNo="
+
user
.
getPhoneNo
()
+
"&token="
+
authBean
.
getToken
());
return
userUIAddr
+
"/weixin/callback?phoneNo="
+
user
.
getPhoneNo
()
+
"&token="
+
authBean
.
getToken
();
}
return
null
;
...
...
@@ -253,7 +255,6 @@ public class WeChatController {
}
private
String
assembleNormalRedirectUrl
(
Merchant
merchant
)
{
LOGGER
.
info
(
"微信登录: assembleNormalRedirectUrl:{} merchant is null:"
,
merchant
==
null
);
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
return
userUIAddr
+
"/landing?key=baitiao&target=cashTarget5®isterFrom=198&channelId=222"
;
}
else
{
...
...
@@ -262,7 +263,6 @@ public class WeChatController {
}
private
String
assembleWechatRedirectUrl
(
Merchant
merchant
,
WechatUserInfo
userInfo
)
{
LOGGER
.
info
(
"微信登录: assembleWechatRedirectUrl:{} merchant is null:"
,
merchant
==
null
);
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
return
userUIAddr
+
"/landing?key=baitiao&target=cashTarget5®isterFrom=198&channelId=222&isWechat=true&openId="
+
userInfo
.
getOpenId
();
}
else
{
...
...
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