| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("api/v2/config")
|
| | | public class ConfigControllerV2 {
|
| | |
|
| | |
| | | @RequestMapping(value = "getWebConfig", method = RequestMethod.POST)
|
| | | public void getWebConfig(AcceptData acceptData, String url, PrintWriter out) {
|
| | | JSONObject data = new JSONObject();
|
| | | if (url != null && (url.contains("s.click") || url.contains("taobao.com") || url.contains("tmall.com")
|
| | |
|
| | | if (url != null && url.contains("ifeeds.tmall.com/article.html?")) {
|
| | | data.put("baichuan", true);
|
| | | data.put("goodsDetail", false);
|
| | | } else if (url != null && (url.contains("s.click") || url.contains("taobao.com") || url.contains("tmall.com")
|
| | | || url.contains("m.tb.cn"))) {
|
| | | data.put("baichuan", true);// 采用阿里百川的方式加载webview
|
| | | data.put("goodsDetail", true);// 需要拦截商品详情
|
| | | } else if (url != null && (url.contains("jd.com"))) {
|
| | | // 不能包含详情页
|
| | | String skuId = JDUtil.parseJDSkuIdByUrl(url);
|
| | | if (StringUtil.isNullOrEmpty(skuId))// 不能拦截详情页面,防止前端进入死循环
|
| | | if (url.startsWith("https://union-click.jd.com/jdc?"))
|
| | | data.put("goodsDetail", false);
|
| | | else
|
| | | data.put("goodsDetail", true);
|
| | | else
|
| | | data.put("goodsDetail", false);
|
| | |
|
| | | data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
|
| | |
|
| | | } else if (url != null && ((url.contains("yangkeduo.com") && !url.contains("yangkeduo.com/goods.html?")
|
| | | && !url.contains("yangkeduo.com/duo_coupon_landing.html?"))
|
| | | || (url.startsWith("https://p.pinduoduo.com/")))) {
|
| | | data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
|
| | | data.put("goodsDetail", true);// 不需要拦截商品详情
|
| | | } else {
|
| | | data.put("baichuan", false);// 不需要采用阿里百川的方式加载webview
|
| | | data.put("goodsDetail", false);// 不需要拦截商品详情
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|