Authored by tanling

中文重定向的问题

... ... @@ -164,6 +164,18 @@ public class RedirectServiceImpl implements IRedirectService {
private String builderCommonUrl(CommonJumpReqVO commonJumpReqVO){
logger.info("builderCommonUrl request is {}", commonJumpReqVO);
String go_url = commonJumpReqVO.getGo_url();
if (StringUtils.isNotBlank(go_url)){
try{
StringBuilder goUrlTemp = new StringBuilder();
goUrlTemp.append(go_url.substring(0,go_url.lastIndexOf("/")+1));
goUrlTemp.append(URLEncoder.encode(go_url.substring(go_url.lastIndexOf("/")+1),"UTF-8"));
go_url = goUrlTemp.toString();
}catch (UnsupportedEncodingException e){
logger.error("builderCommonUrl go_url is {}", go_url);
}
}
//如果go_url没有http:需要代码加上,不然301跳转不过去
StringBuffer bf = new StringBuffer();
if(!go_url.startsWith("http")){
... ...