admin
2019-10-17 e2c9fab4823b9a9a8a186951faa5a54d1f57fb1f
fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoBaoUtil.java
@@ -1371,7 +1371,7 @@
         return null;
      }
   }
   /**
    * 获取商品的用户分成比例
    * 
@@ -1977,7 +1977,7 @@
               if (content.contains("var _DATA_Mdskip")) {
                  content = content.replace("<script>", "");
                  content = content.replace("</script>", "");
                  if (content.contains("videoDetail")) {
                     content += ";function getData(){ var json={title:_DATA_Mdskip.item.title,pictUrl:_DATA_Mdskip.item.videoDetail.videoThumbnailURL};   return JSON.stringify(json);}";
                  } else {
@@ -2007,22 +2007,24 @@
      }
      return taoBaoGoodsBrief;
   }
   /**
    * 抖音返利local 获取真实淘宝链接
    * @param url https://s.click.taobao.com/t?e=m%3D2%26s%3DT9DFpHQCT7Rw4vFB6t2Z2ueEDrYVVa64XoO8tOebS+dRAdhuF14FMR8
    *
    * @param url
    *            https://s.click.taobao.com/t?e=m%3D2%26s%
    *            3DT9DFpHQCT7Rw4vFB6t2Z2ueEDrYVVa64XoO8tOebS+dRAdhuF14FMR8
    * @return
    */
   public static String getRealUrl(String url) {
      if (StringUtil.isNullOrEmpty(url))
         return null;
      try {
         HttpClient client = new HttpClient(new MultiThreadedHttpConnectionManager());
         client.getHttpConnectionManager().getParams().setConnectionTimeout(10000);
         client.getParams().setParameter(HttpMethodParams.USER_AGENT,"Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"); // 让服务器认为是IE
         client.getParams().setParameter(HttpMethodParams.USER_AGENT,
               "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"); // 让服务器认为是IE
         GetMethod get = new GetMethod(url);
         get.setFollowRedirects(false); // 禁止自动重定向
         int iGetResultCode = client.executeMethod(get);
@@ -2037,7 +2039,6 @@
      }
      return null;
   }
   /**
    * 淘口令过滤
@@ -2048,10 +2049,10 @@
   public static String filterTaoToken(String token) {
      if (StringUtil.isNullOrEmpty(token))
         return token;
      if (token.contains("¥")||token.contains("€")) {
      if (token.contains("¥") || token.contains("€")) {
         String newToken = "";
         for (int i = 0; i < token.length(); i++) {
            if (token.charAt(i) == '¥'||token.charAt(i) == '€') {
            if (token.charAt(i) == '¥' || token.charAt(i) == '€') {
               if (!newToken.contains("("))
                  newToken += "(";
               else
@@ -2063,8 +2064,12 @@
      }
      return token;
   }
   public static boolean isSpecialGoods(Integer materialLibType) {
      if (materialLibType != null && materialLibType == 1)
         return true;
      else
         return false;
   }
}