From c5410b7f48a774e4ecd50019b46bc9173f2483ae Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 08 五月 2019 11:33:37 +0800 Subject: [PATCH] 转大淘客为普通商品详情 --- fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java | 82 ++--------------------------------------- 1 files changed, 4 insertions(+), 78 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java index 1f3650f..e0b2c6d 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAuthController.java @@ -14,8 +14,8 @@ import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo; import com.yeshi.fanli.service.inter.config.ConfigService; import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService; -import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; +import com.yeshi.fanli.util.TaoBaoConstant; import com.yeshi.fanli.util.taobao.TaoBaoUtil; import net.sf.json.JSONObject; @@ -61,80 +61,6 @@ return; } - - - - - - // - UserExtraTaoBaoInfo user = userExtraTaoBaoInfoService.getByUid(uid); - if ("share".equalsIgnoreCase(source)) { - if (user != null && !StringUtil.isNullOrEmpty(user.getRelationId()) && user.getRelationValid()) { - out.print(JsonUtil.loadFalseResult(1, "鏃犻渶鎺堟潈")); - return; - } - - } else { - if (user != null && !StringUtil.isNullOrEmpty(user.getSpecialId()) && user.getSpecialValid()) { - out.print(JsonUtil.loadFalseResult(1, "鏃犻渶鎺堟潈")); - return; - } - } - - String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(Constant.TAOBAO_AUTH_APPKEY, - "http://api.flqapp.com/fanli/client/v1/auth/callback/tb", uid, source); - - String orderJS = "var orderId= document.getElementById('tp-bought-root').getElementsByClassName('js-order-container')[0].getElementsByTagName('div')[0].getAttribute('data-id');"; - orderJS += "if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href='yestv://taobaoorder#'+orderId;} else {window.handle.showOrder(orderId)}"; - JSONObject data = new JSONObject(); - data.put("authLink", link); - try { - data.put("orderJS", DESUtil.encode(orderJS, StringUtil.getBase64String("YeShiFANLI889*+"), - StringUtil.getBase64String("*M#34f?,"))); - } catch (Exception e) { - e.printStackTrace(); - } - - data.put("orderUrl", "https://buyertrade.taobao.com/trade/itemlist/list_bought_items.htm"); - if (first) - out.print(JsonUtil.loadTrueResult(data)); - else - out.print(JsonUtil.loadTrue(0, data, "娣樺疂鎺堟潈鏈垚鍔燂紝璇风◢鍚庡啀璇�")); - } - - - /** - * 鑾峰彇娣樺疂鎺堟潈淇℃伅 - * - * @param acceptData - * @param uid - * @param source - * @param out - */ - @RequestMapping(value = "getTaoBaoAuthInfoNew", method = RequestMethod.POST) - public void getTaoBaoAuthInfoNew(AcceptData acceptData, Long uid, String source, Boolean first, PrintWriter out) { - - if (uid == null) { - out.print(JsonUtil.loadFalseResult(2, "鐢ㄦ埛鏈櫥褰�")); - return; - } - - if (StringUtil.isNullOrEmpty(source)) { - out.print(JsonUtil.loadFalseResult(3, "鏉ユ簮閿欒")); - return; - } - - if (first == null) { - out.print(JsonUtil.loadFalseResult(4, "璇蜂紶first")); - return; - } - - if (!"1".equalsIgnoreCase(configService.get("open_speical_and_relation_apply"))) { - out.print(JsonUtil.loadFalseResult(1, "鏆備笉寮�鏀剧敵璇�")); - return; - } - - // UserExtraTaoBaoInfo user = userExtraTaoBaoInfoService.getByUid(uid); if ("share".equalsIgnoreCase(source)) { if (user != null && !StringUtil.isNullOrEmpty(user.getRelationId()) && user.getRelationValid()) { @@ -149,11 +75,10 @@ } } - String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(Constant.TAOBAO_AUTH_APPKEY, + String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(TaoBaoConstant.TAOBAO_AUTH_APPKEY, "http://api.flqapp.com/fanli/client/v1/auth/callback/tb", uid, source); - String orderJS = "var orderId= document.getElementById('tp-bought-root').getElementsByClassName('js-order-container')[0].getElementsByTagName('div')[0].getAttribute('data-id');"; - orderJS += "if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href='yestv://taobaoorder#'+orderId;} else {window.handle.showOrder(orderId)}"; + String orderJS=configService.get("taobao_order_parse_js"); JSONObject data = new JSONObject(); data.put("authLink", link); try { @@ -169,6 +94,7 @@ else out.print(JsonUtil.loadTrue(0, data, "娣樺疂鎺堟潈鏈垚鍔燂紝璇风◢鍚庡啀璇�")); } + } -- Gitblit v1.8.0