Commit ec373b86 authored by 技术部—现金贷—曾丽宾's avatar 技术部—现金贷—曾丽宾

Merge remote-tracking branch 'origin/wechat-forward'

parents 31f39e05 d18fa48c
......@@ -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);
}
}
......@@ -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
......@@ -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
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment