| | |
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
| | | @Resource
|
| | | private TaoBaoUnionAuthRecordService taoBaoUnionAuthRecordService;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @RequestMapping(value = "tb")
|
| | | public void tb(String code, String state, HttpServletRequest request, HttpServletResponse response) {
|
| | |
|
| | | LogHelper.test("淘宝授权回调:" + code + ":" + state);
|
| | | if (StringUtil.isNullOrEmpty(code) || StringUtil.isNullOrEmpty(state)) {
|
| | | LogHelper.error("淘宝授权回调出错");
|
| | |
| | | e1.printStackTrace();
|
| | | }
|
| | | return;
|
| | | }
|
| | | try {
|
| | | String key = StringUtil.Md5("taobao-code-" + code);
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key)))
|
| | | return;
|
| | | redisManager.cacheCommonString(key, 1 + "", 5);
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | String stateStr = AESUtil.decrypt(state, Constant.UIDAESKEY);
|
| | | int errCode = 0;
|
| | |
| | | } else if ("zigou".equalsIgnoreCase(source)) {
|
| | | response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=0");
|
| | | } else if ("bind".equalsIgnoreCase(source)) {
|
| | | response.getWriter().print("<script>yestv.toast(\"恭喜你,淘宝绑定成功\");yestv.finishPage();</script>");
|
| | | String script = String.format(
|
| | | "<script>if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href = 'yestv://toast#%s';setTimeout(function(){window.location.href = 'yestv://finishPage';},100);} else {yestv.toast(\"恭喜你,淘宝绑定成功\");yestv.finishPage();}</script>",
|
| | | StringUtil.getBase64String("恭喜你,淘宝绑定成功"));
|
| | | response.getWriter().print(script);
|
| | | }
|
| | | } else {// 失败
|
| | | if ("share".equalsIgnoreCase(source)) {
|
| | |
| | | } else if ("zigou".equalsIgnoreCase(source)) {
|
| | | response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=1");
|
| | | } else if ("bind".equalsIgnoreCase(source)) {
|
| | | response.getWriter().print("<script>yestv.toast(\"抱歉,淘宝绑定失败\");yestv.finishPage();</script>");
|
| | | String script = String.format(
|
| | | "<script>if(/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {window.location.href = 'yestv://toast#%s';setTimeout(function(){window.location.href = 'yestv://finishPage';},100);} else {yestv.toast(\"抱歉,淘宝绑定失败\");yestv.finishPage();}</script>",
|
| | | StringUtil.getBase64String("抱歉,淘宝绑定失败"));
|
| | | response.getWriter().print(script);
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|