yujian
2019-08-05 15f14208c599f2c7516671bebd83c6ae89c8cda4
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -16,7 +16,6 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.NumberUtil;
import org.yeshi.utils.taobao.TbImgUtil;
import com.google.gson.Gson;
@@ -119,6 +118,8 @@
         out.print(JsonUtil.loadFalseResult("值为空"));
         return;
      }
      //去除前后空格
      text=text.trim();
      if (text.length() > 256) {
         out.print(JsonUtil.loadFalseResult("值过长"));
@@ -131,17 +132,9 @@
      Pattern p = Pattern.compile(URL_REGEX);
      Matcher matcher = p.matcher(text);
      if (!matcher.find()) {// 不包含链接
         // 商品详情
         // 发现
         // 没有链接,标题过长也不处理
         if (text.startsWith("【") && text.contains("】")) {
            int end = text.indexOf("】");
            if (end > 2)
               text = text.substring(1, end);
         }
         if (NumberUtil.isNumeric(text)) {
            out.println(JsonUtil.loadFalseResult("不支持纯数字"));
         String pattern = "^[A-Za-z0-9-]+$";
         if (Pattern.matches(pattern, text)) {
            out.println(JsonUtil.loadFalseResult("不支持推荐"));
            return;
         }