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
ec373b86
Commit
ec373b86
authored
Jun 06, 2017
by
技术部—现金贷—曾丽宾
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/wechat-forward'
parents
31f39e05
d18fa48c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
4 deletions
+36
-4
WeChatController.java
...group/xyqb/controller/external/user/WeChatController.java
+28
-1
xyqb.properties
src/main/resources/config/dev/xyqb.properties
+2
-1
xyqb.properties
src/main/resources/config/release01/xyqb.properties
+3
-1
xyqb.properties
src/main/resources/config/test/xyqb.properties
+3
-1
No files found.
src/main/java/cn/quantgroup/xyqb/controller/external/user/WeChatController.java
View file @
ec373b86
...
...
@@ -7,6 +7,7 @@ import cn.quantgroup.xyqb.entity.User;
import
cn.quantgroup.xyqb.entity.WechatUserInfo
;
import
cn.quantgroup.xyqb.model.AuthBean
;
import
cn.quantgroup.xyqb.model.webchat.AccessTokenResponse
;
import
cn.quantgroup.xyqb.service.http.IHttpService
;
import
cn.quantgroup.xyqb.service.merchant.IMerchantService
;
import
cn.quantgroup.xyqb.service.session.ISessionService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
...
...
@@ -14,6 +15,9 @@ import cn.quantgroup.xyqb.service.wechat.IWechatService;
import
cn.quantgroup.xyqb.util.EmojiUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.google.common.base.Joiner
;
import
com.google.common.collect.ImmutableList
;
import
com.google.common.collect.ImmutableMap
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -21,16 +25,21 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.Arrays
;
import
java.util.Enumeration
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* Created by 11 on 2017/1/17.
...
...
@@ -64,6 +73,12 @@ public class WeChatController implements IBaseController {
@Value
(
"${xyqb.user.domain}"
)
private
String
userDomainStr
;
@Value
(
"${xyqb.domain}"
)
private
String
xyqbDomainStr
;
@Autowired
private
IHttpService
httpService
;
/**
* 开发者资质认证,有必要吗?
*
...
...
@@ -447,5 +462,17 @@ public class WeChatController implements IBaseController {
}
}
@RequestMapping
(
"/active_redirect"
)
public
void
forwardWechatRequest
(
HttpServletRequest
request
,
HttpServletResponse
response
){
String
redirectUrl
=
xyqbDomainStr
+
"/api/coupon/activity/wechat/rent_house/bargain?"
;
Enumeration
<
String
>
parameterNames
=
request
.
getParameterNames
();
ImmutableList
.
Builder
<
String
>
builder
=
ImmutableList
.
builder
();
while
(
parameterNames
.
hasMoreElements
()){
String
name
=
parameterNames
.
nextElement
();
builder
.
add
(
name
.
concat
(
"="
).
concat
(
request
.
getParameter
(
name
)));
}
redirectUrl
=
redirectUrl
.
concat
(
Joiner
.
on
(
"&"
).
join
(
builder
.
build
()));
response
.
setHeader
(
"Location"
,
redirectUrl
);
response
.
setStatus
(
301
);
}
}
src/main/resources/config/dev/xyqb.properties
View file @
ec373b86
...
...
@@ -88,4 +88,5 @@ motan.application=xyqbUserMotan
#xyqb-user-域名
xyqb.user.domain
=
passport.xyqb.com
xyqb.user.query.url
=
http://192.168.11.40:8081
\ No newline at end of file
xyqb.user.query.url
=
http://192.168.11.40:8081
xyqb.domain
=
http://192.168.4.153:7003
\ No newline at end of file
src/main/resources/config/release01/xyqb.properties
View file @
ec373b86
...
...
@@ -51,4 +51,6 @@ motan.application=xyqbUserMotan
#xyqb-user-域名
xyqb.user.domain
=
passport.xyqb.com
xyqb.user.query.url
=
http://userqry.xyqb.com
\ No newline at end of file
xyqb.user.query.url
=
http://userqry.xyqb.com
xyqb.domain
=
http://api.xyqb.com
\ No newline at end of file
src/main/resources/config/test/xyqb.properties
View file @
ec373b86
...
...
@@ -52,4 +52,6 @@ wechat.secret=16eaec16084d0d9c52d4114f359cc72c
#xyqb-user-域名
xyqb.user.domain
=
passport.xyqb.com
xyqb.user.query.url
=
http://userqry.xyqb.com
\ No newline at end of file
xyqb.user.query.url
=
http://userqry.xyqb.com
xyqb.domain
=
http://192.168.4.153:7003
\ No newline at end of file
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