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
258bc91c
Commit
258bc91c
authored
Feb 09, 2017
by
lee_mingzhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add log
parent
9cf013d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
WeChatController.java
...group/xyqb/controller/external/user/WeChatController.java
+8
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/WeChatController.java
View file @
258bc91c
...
@@ -14,6 +14,8 @@ import cn.quantgroup.xyqb.service.user.IUserService;
...
@@ -14,6 +14,8 @@ import cn.quantgroup.xyqb.service.user.IUserService;
import
cn.quantgroup.xyqb.service.wechat.IWechatService
;
import
cn.quantgroup.xyqb.service.wechat.IWechatService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
@@ -34,6 +36,8 @@ import java.util.Arrays;
...
@@ -34,6 +36,8 @@ import java.util.Arrays;
@RequestMapping
(
"/wechat"
)
@RequestMapping
(
"/wechat"
)
public
class
WeChatController
{
public
class
WeChatController
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
WeChatController
.
class
);
// todo: 配置文件
// todo: 配置文件
private
static
final
String
TOKEN
=
"5YihkluEo5QuWAWpFwzvA"
;
private
static
final
String
TOKEN
=
"5YihkluEo5QuWAWpFwzvA"
;
...
@@ -169,6 +173,7 @@ public class WeChatController {
...
@@ -169,6 +173,7 @@ public class WeChatController {
*/
*/
@RequestMapping
(
"/receiveCode/{key}"
)
@RequestMapping
(
"/receiveCode/{key}"
)
public
void
receiveCode
(
String
code
,
@PathVariable
(
value
=
"key"
)
String
systemKey
,
HttpServletResponse
response
)
{
public
void
receiveCode
(
String
code
,
@PathVariable
(
value
=
"key"
)
String
systemKey
,
HttpServletResponse
response
)
{
LOGGER
.
info
(
"微信登录:"
+
systemKey
);
// 从code获取token
// 从code获取token
Merchant
merchant
=
merchantService
.
findMerchantByName
(
systemKey
);
Merchant
merchant
=
merchantService
.
findMerchantByName
(
systemKey
);
...
@@ -210,6 +215,7 @@ public class WeChatController {
...
@@ -210,6 +215,7 @@ public class WeChatController {
}
}
private
String
createUserSession
(
User
user
,
Merchant
merchant
)
{
private
String
createUserSession
(
User
user
,
Merchant
merchant
)
{
LOGGER
.
info
(
"微信登录: createUserSession:{} merchant is null:"
,
merchant
==
null
);
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
return
loginInWechatWithSessionCreated
(
user
,
merchant
,
"cashTarget5"
,
Constants
.
Channel
.
BAITIAO
);
return
loginInWechatWithSessionCreated
(
user
,
merchant
,
"cashTarget5"
,
Constants
.
Channel
.
BAITIAO
);
}
else
{
}
else
{
...
@@ -235,6 +241,7 @@ public class WeChatController {
...
@@ -235,6 +241,7 @@ public class WeChatController {
}
}
private
String
assembleNormalRedirectUrl
(
Merchant
merchant
)
{
private
String
assembleNormalRedirectUrl
(
Merchant
merchant
)
{
LOGGER
.
info
(
"微信登录: assembleNormalRedirectUrl:{} merchant is null:"
,
merchant
==
null
);
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
return
userUIAddr
+
"/landing?key=baitiao&target=cashTarget5®isterFrom=198&channelId=222"
;
return
userUIAddr
+
"/landing?key=baitiao&target=cashTarget5®isterFrom=198&channelId=222"
;
}
else
{
}
else
{
...
@@ -243,6 +250,7 @@ public class WeChatController {
...
@@ -243,6 +250,7 @@ public class WeChatController {
}
}
private
String
assembleWechatRedirectUrl
(
Merchant
merchant
,
WechatUserInfo
userInfo
)
{
private
String
assembleWechatRedirectUrl
(
Merchant
merchant
,
WechatUserInfo
userInfo
)
{
LOGGER
.
info
(
"微信登录: assembleWechatRedirectUrl:{} merchant is null:"
,
merchant
==
null
);
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
if
(
"baitiao"
.
equals
(
merchant
.
getName
()))
{
return
userUIAddr
+
"/landing?key=baitiao&target=cashTarget5®isterFrom=198&channelId=222&isWechat=true&openId="
+
userInfo
.
getOpenId
();
return
userUIAddr
+
"/landing?key=baitiao&target=cashTarget5®isterFrom=198&channelId=222&isWechat=true&openId="
+
userInfo
.
getOpenId
();
}
else
{
}
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