Authored by zhengwen.ge

update

... ... @@ -147,16 +147,21 @@ public class RedirectServiceImpl implements IRedirectService {
private String builderCommonUrl(CommonJumpReqVO commonJumpReqVO){
logger.info("builderCommonUrl request is {}", commonJumpReqVO);
String param = this.generateReqParam(commonJumpReqVO);
// String param = this.generateReqParam(commonJumpReqVO);
String go_url = commonJumpReqVO.getGo_url();
StringBuffer targetUrl = new StringBuffer(commonJumpReqVO.getGo_url());
targetUrl = StringUtils.isEmpty(targetUrl) ? new StringBuffer(WAP_URL) : targetUrl;
String redirectUrl = null;
if(go_url.contains("m.yohobuy")){
redirectUrl = WAP_REDIRECT_URL;
// String redirectUrl = null;
if(targetUrl.toString().contains("?")){
targetUrl.append("&union_type=").append(commonJumpReqVO.getUnion_type());
}else {
redirectUrl = WEB_REDIRECT_URL;
targetUrl.append("?union_type=").append(commonJumpReqVO.getUnion_type());
}
// if(go_url.contains("m.yohobuy")){
// redirectUrl = WAP_REDIRECT_URL;
// }else {
// redirectUrl = WEB_REDIRECT_URL;
// }
// if (targetUrl.toString().contains("?")) {
// if(targetUrl.toString().contains("utm_source=")){
// targetUrl.append("&utm_medium=").append(commonJumpReqVO.getUtm_medium()).append("&utm_campaign=").append(commonJumpReqVO.getUtm_campaign());
... ... @@ -166,18 +171,18 @@ public class RedirectServiceImpl implements IRedirectService {
// } else {
// targetUrl.append("?utm_source=").append(commonJumpReqVO.getUtm_source()).append("&utm_medium=").append(commonJumpReqVO.getUtm_medium()).append("&utm_campaign=").append(commonJumpReqVO.getUtm_campaign());
// }
try {
param = URLEncoder.encode(param, "UTF-8");
targetUrl = new StringBuffer(URLEncoder.encode(targetUrl.toString(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
logger.warn("builderUrlForPanshi: urlEncode failed: request param is {}", commonJumpReqVO);
}
StringBuilder urlBuilder = new StringBuilder();
urlBuilder.append(redirectUrl).append("?_QYH_UNION=");
urlBuilder.append(param).append("&target=");
urlBuilder.append(targetUrl);
logger.info("builderCommonUrl url is {}", urlBuilder.toString());
return urlBuilder.toString();
// try {
// param = URLEncoder.encode(param, "UTF-8");
// targetUrl = new StringBuffer(URLEncoder.encode(targetUrl.toString(), "UTF-8"));
// } catch (UnsupportedEncodingException e) {
// logger.warn("builderUrlForPanshi: urlEncode failed: request param is {}", commonJumpReqVO);
// }
// StringBuilder urlBuilder = new StringBuilder();
// urlBuilder.append(redirectUrl).append("?_QYH_UNION=");
// urlBuilder.append(param).append("&target=");
// urlBuilder.append(targetUrl);
logger.info("builderCommonUrl url is {}", targetUrl.toString());
return targetUrl.toString();
}
/**
... ...