admin
2019-02-20 af9720d768a775f433a01e68f8c9d995924fed44
fanli/src/main/java/com/yeshi/fanli/controller/AuthCallBackController.java
@@ -6,6 +6,7 @@
import java.util.Date;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
@@ -13,6 +14,7 @@
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.taobao.TaoBaoUnionAuthRecord;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionAuthRecordService;
import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
import com.yeshi.fanli.util.AESUtil;
@@ -39,9 +41,10 @@
   private TaoBaoUnionAuthRecordService taoBaoUnionAuthRecordService;
   @RequestMapping(value = "tb")
   public void tb(String code, String state, HttpServletResponse response) {
      if (StringUtil.isNullOrEmpty(code) || StringUtil.isNullOrEmpty(state))
      {
   public void tb(String code, String state, HttpServletRequest request, HttpServletResponse response) {
      LogHelper.test("淘宝授权回调:" + code + ":" + state);
      if (StringUtil.isNullOrEmpty(code) || StringUtil.isNullOrEmpty(state)) {
         LogHelper.error("淘宝授权回调出错");
         try {
            response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_bonusState.html?code=1");
         } catch (IOException e1) {
@@ -66,20 +69,6 @@
      if (uid == null || uid.longValue() == 0L)
         errCode = 3;
      if (uid == 911382L) {
         try {
            if ("share".equalsIgnoreCase(source))
               response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_bonusState.html?code=1");
            else
               response.sendRedirect("http://apph5.yeshitv.com/apppage/flq_rebateState.html?code=1");
         } catch (IOException e) {
         }
         return;
      }
      // 计入记录
      try {
@@ -91,6 +80,9 @@
         String openUid = data.optString("taobao_open_uid");
         String taoBaoUid = data.optString("taobao_user_id");
         String nickName = data.optString("taobao_user_nick");
         LogHelper.test("uid:" + uid + "\n accessToken:" + accessToken);
         // 获取渠道ID与会员ID
         if ("share".equalsIgnoreCase(source)) {
            String relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY,
@@ -117,6 +109,11 @@
         taoBaoUnionAuthRecordService.addAuthRecord(record);
      } catch (Exception e) {
         errCode = 4;
         try {
            LogHelper.errorDetailInfo(e);
         } catch (Exception e1) {
            e1.printStackTrace();
         }
      }
      try {