Authored by zhengwen.ge

update

@@ -147,16 +147,21 @@ public class RedirectServiceImpl implements IRedirectService { @@ -147,16 +147,21 @@ public class RedirectServiceImpl implements IRedirectService {
147 147
148 private String builderCommonUrl(CommonJumpReqVO commonJumpReqVO){ 148 private String builderCommonUrl(CommonJumpReqVO commonJumpReqVO){
149 logger.info("builderCommonUrl request is {}", commonJumpReqVO); 149 logger.info("builderCommonUrl request is {}", commonJumpReqVO);
150 - String param = this.generateReqParam(commonJumpReqVO); 150 +// String param = this.generateReqParam(commonJumpReqVO);
151 String go_url = commonJumpReqVO.getGo_url(); 151 String go_url = commonJumpReqVO.getGo_url();
152 StringBuffer targetUrl = new StringBuffer(commonJumpReqVO.getGo_url()); 152 StringBuffer targetUrl = new StringBuffer(commonJumpReqVO.getGo_url());
153 targetUrl = StringUtils.isEmpty(targetUrl) ? new StringBuffer(WAP_URL) : targetUrl; 153 targetUrl = StringUtils.isEmpty(targetUrl) ? new StringBuffer(WAP_URL) : targetUrl;
154 - String redirectUrl = null;  
155 - if(go_url.contains("m.yohobuy")){  
156 - redirectUrl = WAP_REDIRECT_URL; 154 +// String redirectUrl = null;
  155 + if(targetUrl.toString().contains("?")){
  156 + targetUrl.append("&union_type=").append(commonJumpReqVO.getUnion_type());
157 }else { 157 }else {
158 - redirectUrl = WEB_REDIRECT_URL; 158 + targetUrl.append("?union_type=").append(commonJumpReqVO.getUnion_type());
159 } 159 }
  160 +// if(go_url.contains("m.yohobuy")){
  161 +// redirectUrl = WAP_REDIRECT_URL;
  162 +// }else {
  163 +// redirectUrl = WEB_REDIRECT_URL;
  164 +// }
160 // if (targetUrl.toString().contains("?")) { 165 // if (targetUrl.toString().contains("?")) {
161 // if(targetUrl.toString().contains("utm_source=")){ 166 // if(targetUrl.toString().contains("utm_source=")){
162 // targetUrl.append("&utm_medium=").append(commonJumpReqVO.getUtm_medium()).append("&utm_campaign=").append(commonJumpReqVO.getUtm_campaign()); 167 // targetUrl.append("&utm_medium=").append(commonJumpReqVO.getUtm_medium()).append("&utm_campaign=").append(commonJumpReqVO.getUtm_campaign());
@@ -166,18 +171,18 @@ public class RedirectServiceImpl implements IRedirectService { @@ -166,18 +171,18 @@ public class RedirectServiceImpl implements IRedirectService {
166 // } else { 171 // } else {
167 // targetUrl.append("?utm_source=").append(commonJumpReqVO.getUtm_source()).append("&utm_medium=").append(commonJumpReqVO.getUtm_medium()).append("&utm_campaign=").append(commonJumpReqVO.getUtm_campaign()); 172 // targetUrl.append("?utm_source=").append(commonJumpReqVO.getUtm_source()).append("&utm_medium=").append(commonJumpReqVO.getUtm_medium()).append("&utm_campaign=").append(commonJumpReqVO.getUtm_campaign());
168 // } 173 // }
169 - try {  
170 - param = URLEncoder.encode(param, "UTF-8");  
171 - targetUrl = new StringBuffer(URLEncoder.encode(targetUrl.toString(), "UTF-8"));  
172 - } catch (UnsupportedEncodingException e) {  
173 - logger.warn("builderUrlForPanshi: urlEncode failed: request param is {}", commonJumpReqVO);  
174 - }  
175 - StringBuilder urlBuilder = new StringBuilder();  
176 - urlBuilder.append(redirectUrl).append("?_QYH_UNION=");  
177 - urlBuilder.append(param).append("&target=");  
178 - urlBuilder.append(targetUrl);  
179 - logger.info("builderCommonUrl url is {}", urlBuilder.toString());  
180 - return urlBuilder.toString(); 174 +// try {
  175 +// param = URLEncoder.encode(param, "UTF-8");
  176 +// targetUrl = new StringBuffer(URLEncoder.encode(targetUrl.toString(), "UTF-8"));
  177 +// } catch (UnsupportedEncodingException e) {
  178 +// logger.warn("builderUrlForPanshi: urlEncode failed: request param is {}", commonJumpReqVO);
  179 +// }
  180 +// StringBuilder urlBuilder = new StringBuilder();
  181 +// urlBuilder.append(redirectUrl).append("?_QYH_UNION=");
  182 +// urlBuilder.append(param).append("&target=");
  183 +// urlBuilder.append(targetUrl);
  184 + logger.info("builderCommonUrl url is {}", targetUrl.toString());
  185 + return targetUrl.toString();
181 } 186 }
182 187
183 /** 188 /**