Bläddra i källkod

调整刷新token

yumeng 5 år sedan
förälder
incheckning
60978aa51d

+ 82 - 53
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/CallbackController.java

@@ -11,6 +11,7 @@ import cn.com.ctop.kuaishou.modules.material.entity.KuaishouAccessToken;
 import cn.com.ctop.kuaishou.modules.material.entity.KuaishouResultToken;
 import cn.com.ctop.toutiao.modules.material.service.IByteDanceAdvertiserDataService;
 import cn.com.ctop.toutiao.modules.report.service.IReportService;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import lombok.extern.slf4j.Slf4j;
@@ -24,7 +25,10 @@ import org.jeecg.modules.system.entity.SysUser;
 import org.jeecg.modules.system.service.ISysDepartService;
 import org.jeecg.modules.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -55,6 +59,9 @@ public class CallbackController {
     private ICtopOauthTokenService ctopOauthTokenService;
     @Autowired
     private IByteDanceAdvertiserDataService advertiserDataService;
+    @Autowired
+    private IReportService reportService;
+
 
 
     @GetMapping("/qywexin")
@@ -101,7 +108,6 @@ public class CallbackController {
     }
 
     /**
-     *
      * @param request
      * @param response
      * @param authCode
@@ -232,10 +238,6 @@ public class CallbackController {
 
         if (StringUtils.isNotBlank(authCode)) {
             Map<String, Object> map = this.getByteDanceAccessToken(authCode, state);
-            Integer code = (Integer) map.get("code");
-            if (code == 0) {
-                return "授权绑定成功";
-            }
             log.info("返回信息:{}", map.toString());
             return (String) map.get("desc");
         }
@@ -282,59 +284,86 @@ public class CallbackController {
             BigDecimal warningAmount = json.getBigDecimal("WarningAmount");
 
             JSONObject data = resultObject.getJSONObject("data");
-            CtopOauthToken token = new CtopOauthToken(advertiserId, data);
-            ctopOauthTokenService.saveOrUpdate(token);
-            //获取广告主信息
-            Map<String, Object> advertiserDataMap = advertiserDataService.getAdvertiserInfo(token.getAccountId() + "");
-            Boolean getSuccess = (Boolean) advertiserDataMap.get("success");
-            if (null == getSuccess || !getSuccess) {
-                log.info("获取广告主信息失败,accountId:{},message:{}", token.getAccountId(), (String) advertiserDataMap.get("message"));
-                throw new Exception("获取广告主信息失败");
+
+            if (Check.isNull(data)) {
+                returnMap.put("code", -1);
+                returnMap.put("desc", "返回信息为空");
+                return returnMap;
+
             }
 
-            Long accountId = token.getAccountId();
-            QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
-            userAllocationQueryWrapper.eq("account_id", accountId);
-            userAllocationQueryWrapper.eq("media_id", 1);
-            userAllocationQueryWrapper.orderByDesc("create_time");
-            userAllocationQueryWrapper.last("limit 1");
-            UserAllocation checkUserAllocation = allocationMapper.selectOne(userAllocationQueryWrapper);
-            if (!Check.isNull(checkUserAllocation)) {
+            data.remove("advertiser_id");
+            JSONArray advertiser_ids = data.getJSONArray("advertiser_ids");
+            if (Check.isNull(advertiser_ids)) {
                 returnMap.put("code", -1);
-                returnMap.put("desc", "授权失败,账号已被:" + checkUserAllocation.getUserName() + "绑定");
+                returnMap.put("desc", "请选择需要授权的账号");
                 return returnMap;
+
             }
 
-            String systemType = json.getString("systemType");
-            UserAllocation userAllocation = new UserAllocation();
-            userAllocation.setUserId(userId);
-            userAllocation.setUserName(userName);
-            userAllocation.setAccountId(token.getAccountId());
-            userAllocation.setAdvertiserName(advertiserName);
-            userAllocation.setMediaId(mediaId);
-            userAllocation.setProjectId(projectId);
-            userAllocation.setProjectName(projectName);
-            userAllocation.setSystemType(systemType);
-            userAllocation.setAuthName((String) advertiserDataMap.get("name"));
-            userAllocation.setAdvertiserId(advertiserId);
-            userAllocation.setWarningProportion(warningProportion);
-            userAllocation.setWarningAmount(warningAmount);
-            userAllocation.setCreateTime(new Date());
-            userAllocation.setUpdateTime(new Date());
-            allocationMapper.deleteById(userAllocation.getId());
-            Map<String, Object> deleteUserMap = new HashMap<>();
-            deleteUserMap.put("advertiser_id", advertiserId);
-            deleteUserMap.put("account_id", token.getAccountId());
-            allocationMapper.deleteByMap(deleteUserMap);
-            int i = allocationMapper.insert(userAllocation);
-            if (i > 0) {
-                log.info("同步分配用户表完成,task_id:{},accountId:{}", state, token.getAccountId());
+            data.remove("advertiser_ids");
+            StringBuilder text = new StringBuilder();
+            for (int i = 0; i < advertiser_ids.size(); i++) {
+                Long advertiser_id = advertiser_ids.getLong(i);
+                data.put("advertiser_id", advertiser_id);
+                CtopOauthToken token = new CtopOauthToken(advertiserId, data);
+                ctopOauthTokenService.saveOrUpdate(token);
+                //获取广告主信息
+                Map<String, Object> advertiserDataMap = advertiserDataService.getAdvertiserInfo(token.getAccountId() + "");
+                Boolean getSuccess = (Boolean) advertiserDataMap.get("success");
+                if (null == getSuccess || !getSuccess) {
+                    log.info("获取广告主信息失败,accountId:{},message:{}", token.getAccountId(), (String) advertiserDataMap.get("message"));
+                    continue;
+                }
+
+                Long accountId = token.getAccountId();
+                QueryWrapper<UserAllocation> userAllocationQueryWrapper = new QueryWrapper<>();
+                userAllocationQueryWrapper.eq("account_id", accountId);
+                userAllocationQueryWrapper.eq("media_id", 1);
+                userAllocationQueryWrapper.orderByDesc("create_time");
+                userAllocationQueryWrapper.last("limit 1");
+
+
+                UserAllocation checkUserAllocation = allocationMapper.selectOne(userAllocationQueryWrapper);
+                if (!Check.isNull(checkUserAllocation)) {
+                    text.append("accountId:" + accountId + ",授权名称为:" + (String) advertiserDataMap.get("name") + ",绑定失败,失败原因:已被" + checkUserAllocation.getUserName() + "绑定。")
+                            .append("<br/>");
+                    continue;
+                }
+                text.append("accountId:" + accountId + ",授权名称为:" + (String) advertiserDataMap.get("name") + ",绑定成功。").append("<br/>");
+                String systemType = json.getString("systemType");
+                UserAllocation userAllocation = new UserAllocation();
+                userAllocation.setUserId(userId);
+                userAllocation.setUserName(userName);
+                userAllocation.setAccountId(token.getAccountId());
+                userAllocation.setAdvertiserName(advertiserName);
+                userAllocation.setMediaId(mediaId);
+                userAllocation.setProjectId(projectId);
+                userAllocation.setProjectName(projectName);
+                userAllocation.setSystemType(systemType);
+                userAllocation.setAuthName((String) advertiserDataMap.get("name"));
+                userAllocation.setAdvertiserId(advertiserId);
+                userAllocation.setWarningProportion(warningProportion);
+                userAllocation.setWarningAmount(warningAmount);
+                userAllocation.setCreateTime(new Date());
+                userAllocation.setUpdateTime(new Date());
+                allocationMapper.deleteById(userAllocation.getId());
+                Map<String, Object> deleteUserMap = new HashMap<>();
+                deleteUserMap.put("advertiser_id", advertiserId);
+                deleteUserMap.put("account_id", token.getAccountId());
+                allocationMapper.deleteByMap(deleteUserMap);
+                int j = allocationMapper.insert(userAllocation);
+                if (j > 0) {
+                    log.info("同步分配用户表完成,task_id:{},accountId:{}", state, token.getAccountId());
+                }
+                //账号绑定
+                bindAccountAuthService.addBindAccount(token.getAccountId(), KuaishouInterfaceConstant.LOGIN_TYPE_BYTEDANCE, advertiserId);
+                new Thread(() -> reportService.loadBytedanceHistoryData(token)).start();
             }
-            //账号绑定
-            bindAccountAuthService.addBindAccount(token.getAccountId(), KuaishouInterfaceConstant.LOGIN_TYPE_BYTEDANCE, advertiserId);
-            new Thread(() -> reportService.loadBytedanceHistoryData(token)).start();
+
             returnMap.put("code", 0);
-            returnMap.put("desc", "success");
+            returnMap.put("desc", text);
+
         } catch (Exception e) {
             e.printStackTrace();
             returnMap.put("code", -1);
@@ -343,7 +372,7 @@ public class CallbackController {
         return returnMap;
     }
 
-    @Autowired
-    private IReportService reportService;
+
+
 
 }

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/controller/TestController.java

@@ -203,8 +203,8 @@ public class TestController {
 
 
     @GetMapping(value = "/getToken")
-    public String getToken(Long accountId, String refreshToken, Integer agentType) {
-        oauthTokenService.getKuaiShouRefreshToken(accountId, refreshToken, agentType);
+    public String getToken(Long accountId, String token, String refreshToken, Integer agentType) {
+        oauthTokenService.getKuaiShouRefreshToken(accountId, token, refreshToken, agentType);
         return "Success";
     }
 

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/RefreshTokenJob.java

@@ -6,7 +6,7 @@ import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 import org.springframework.beans.factory.annotation.Autowired;
 
-public class RefreshTokenJob implements Job {
+public class ByteDanceRefreshTokenJob implements Job {
     @Autowired
     private IRefreshTokenService refreshTokenService;
 
@@ -21,7 +21,7 @@ public class RefreshTokenJob implements Job {
         Thread thread = new Thread() {
             @Override
             public void run() {
-                refreshTokenService.getRefresh();
+                refreshTokenService.byteDanceRefresh();
             }
         };
         thread.start();

+ 30 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/ctop/job/KuaiShouRefreshTokenJob.java

@@ -0,0 +1,30 @@
+package org.jeecg.modules.ctop.job;
+
+import cn.com.ctop.common.module.service.IRefreshTokenService;
+import org.quartz.Job;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
+import org.springframework.beans.factory.annotation.Autowired;
+
+public class KuaiShouRefreshTokenJob implements Job {
+    @Autowired
+    private IRefreshTokenService refreshTokenService;
+
+    /**
+     * 刷新token
+     *
+     * @param jobExecutionContext
+     * @throws JobExecutionException
+     */
+    @Override
+    public void execute(JobExecutionContext jobExecutionContext) {
+        Thread thread = new Thread() {
+            @Override
+            public void run() {
+                refreshTokenService.getKuaiShouRefresh();
+            }
+        };
+        thread.start();
+
+    }
+}

+ 3 - 0
module-common/src/main/java/cn/com/ctop/common/module/entity/CtopOauthToken.java

@@ -85,6 +85,9 @@ public class CtopOauthToken {
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "刷新令牌有效期")
     private Date refreshTokenExpiresIn;
+
+
+
     /**
      * 创建时间
      */

+ 22 - 9
module-common/src/main/java/cn/com/ctop/common/module/mapper/CtopOauthTokenMapper.java

@@ -14,14 +14,8 @@ import java.util.List;
  */
 public interface CtopOauthTokenMapper extends BaseMapper<CtopOauthToken> {
     /**
-     * 全查
-     *
-     * @return
-     */
-    List<CtopOauthToken> selectAll();
-
-    /**
      * 更新
+     *
      * @param oauthToken
      * @return
      */
@@ -29,6 +23,7 @@ public interface CtopOauthTokenMapper extends BaseMapper<CtopOauthToken> {
 
     /**
      * 根据accountId查询
+     *
      * @param accountId
      * @return
      */
@@ -38,7 +33,25 @@ public interface CtopOauthTokenMapper extends BaseMapper<CtopOauthToken> {
 
     List<CtopOauthToken> selectToutiaoToken();
 
-    CtopOauthToken getAccessTokenByAccountIdAndMediaId(@Param("mediaId")Integer mediaId, @Param("accountId")Long accountId);
+    CtopOauthToken getAccessTokenByAccountIdAndMediaId(@Param("mediaId") Integer mediaId, @Param("accountId") Long accountId);
+
+    List<CtopOauthToken> getToutiaoTokenByCreateTime(@Param("createTime") String createTime);
+
+    /**
+     * 查询头条token
+     *
+     * @param platformTypeByteDance
+     * @return
+     */
+    List<CtopOauthToken> selectByteDanceTokens(@Param("mediaId") String platformTypeByteDance);
+
+
+    /**
+     * 查询头条token
+     *
+     * @param platformTypeByteDance
+     * @return
+     */
+    List<CtopOauthToken> selectKuaiShouTokens(@Param("mediaId") String platformTypeByteDance);
 
-    List<CtopOauthToken> getToutiaoTokenByCreateTime(@Param("createTime")String createTime);
 }

+ 10 - 1
module-common/src/main/java/cn/com/ctop/common/module/mapper/xml/CtopOauthTokenMapper.xml

@@ -20,10 +20,19 @@
         id,media_id,advertiser_id,account_id,access_token,refresh_token,access_token_expires_in,refresh_token_expires_in,agent_type,create_time,update_time
    </sql>
 
-    <select id="selectAll" resultMap="BaseResultMap">
+    <select id="selectByteDanceTokens" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List"/>
         from ctop_oauth_token
+        where media_id = #{mediaId}
+        group by access_token
+    </select>
+
+    <select id="selectKuaiShouTokens" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from ctop_oauth_token
+        where media_id = #{mediaId}
         group by account_id
     </select>
 

+ 2 - 2
module-common/src/main/java/cn/com/ctop/common/module/service/ICtopOauthTokenService.java

@@ -18,9 +18,9 @@ public interface ICtopOauthTokenService extends IService<CtopOauthToken> {
 
     CtopOauthToken getTokenByAccountId(Long accountId);
 
-    Map<String, Object> getByteDanceAccessToken(String accountId);
+    Map<String, Object> getByteDanceAccessToken(String token, String refreshToken);
 
-    void getKuaiShouRefreshToken(Long accountId, String refreshToken, Integer agentType);
+    void getKuaiShouRefreshToken(Long accountId,String token, String refreshToken, Integer agentType);
 
     List<CtopOauthToken> getTokenListByType(String platformTypeBytedance);
 

+ 3 - 1
module-common/src/main/java/cn/com/ctop/common/module/service/IRefreshTokenService.java

@@ -1,5 +1,7 @@
 package cn.com.ctop.common.module.service;
 
 public interface IRefreshTokenService {
-    void getRefresh();
+    void getKuaiShouRefresh();
+
+    void byteDanceRefresh();
 }

+ 40 - 30
module-common/src/main/java/cn/com/ctop/common/module/service/impl/CtopOauthTokenServiceImpl.java

@@ -13,10 +13,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @Description: oauth授权码
@@ -50,45 +47,48 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
     /**
      * 刷新token
      *
-     * @param accountId
      * @return
      */
     @Override
-    public Map<String, Object> getByteDanceAccessToken(String accountId) {
+    public Map<String, Object> getByteDanceAccessToken(String token, String refreshToken) {
+        log.info("刷新头条token入参,token:{},refreshToken:{}", token, refreshToken);
         Map<String, Object> resultMap = new HashMap<>();
-        CtopOauthToken token = this.getOauthTokenByAccountId(accountId);
-        if (null == token) {
-            resultMap.put("message", "token信息不存在");
-            resultMap.put("code", -1);
-            return resultMap;
-        }
         String url = PropertiesUtils.getValue("bytedance_config", "bytedance_api_url") + "/oauth2/refresh_token";
         Map<String, Object> param = new HashMap<>();
         param.put("app_id", PropertiesUtils.getValue("bytedance_config", "bytedance_appid"));
         param.put("secret", PropertiesUtils.getValue("bytedance_config", "bytedance_secret"));
         param.put("grant_type", "refresh_token");
-        param.put("refresh_token", token.getRefreshToken());
+        param.put("refresh_token", refreshToken);
         String result = HttpUtils.httpPostRequest(url, param, new HashMap<>());
         JSONObject resultObject = JSONObject.parseObject(result);
+        log.info("头条刷新token入参,token:{},refreshToken:{},返回信息:{}", token, refreshToken, resultObject);
         Integer code = resultObject.getInteger("code");
-        if (null == code || code != 0) {
-            log.info("刷新token异常;accountId:{}", accountId);
-            resultMap.put("message", "刷新token异常");
-            resultMap.put("code", -1);
-            return resultMap;
+        if (code == 0) {
+            JSONObject data = resultObject.getJSONObject("data");
+            CtopOauthToken updateRefreshToken = new CtopOauthToken();
+            updateRefreshToken.setAccessToken(data.getString("access_token"));
+            updateRefreshToken.setRefreshToken(data.getString("refresh_token"));
+            Date now = new Date();
+            Integer refreshTokenExpiresIn = data.getInteger("refresh_token_expires_in");
+            Integer expiresIn = data.getInteger("expires_in");
+            updateRefreshToken.setRefreshTokenExpiresIn(addSecond(now, refreshTokenExpiresIn));
+            updateRefreshToken.setAccessTokenExpiresIn(addSecond(now, expiresIn));
+            QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("access_token", token);
+            queryWrapper.eq("media_id", 1);
+            int i = cTopOauthTokenMapper.update(updateRefreshToken, queryWrapper);
+            if (i > 0) {
+                log.info("头条刷新token成功:token:{}", token);
+            }
+            resultMap.put("message", "token刷新成功");
+            resultMap.put("code", 0);
+        } else {
+            resultMap.put("message", "token刷新失败");
+            resultMap.put("token", token);
+            resultMap.put("code", 0);
         }
-        JSONObject data = resultObject.getJSONObject("data");
-        CtopOauthToken refreshToken = new CtopOauthToken(token, data);
-        QueryWrapper<CtopOauthToken> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("account_id", accountId);
-        queryWrapper.eq("media_id", 1);
 
-        int i = cTopOauthTokenMapper.update(refreshToken, queryWrapper);
-        if (i > 0) {
-            log.info("头条刷新token成功:accountId:{}", accountId);
-        }
-        resultMap.put("message", "token刷新成功");
-        resultMap.put("code", 0);
+
         return resultMap;
     }
 
@@ -100,7 +100,10 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
      * @return
      */
     @Override
-    public void getKuaiShouRefreshToken(Long accountId, String refreshToken, Integer agentType) {
+    public void getKuaiShouRefreshToken(Long accountId, String token, String refreshToken, Integer agentType) {
+
+        log.info("快手刷新token入参,accountId:{},token:{},refreshToken:{}", accountId, token, refreshToken);
+
         String url = PropertiesUtils.getConfig("kuaishou_api_url") + "/rest/openapi/oauth2/authorize/refresh_token";
         Map<String, String> headers = new HashMap<>();
         headers.put("Content-Type", " application/json");
@@ -122,6 +125,7 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
             }
             String result = HttpUtils.httpPostRequest(url, param, headers);
             JSONObject resultJson = JSONObject.parseObject(result);
+            log.info("快手刷新token返回结果:{}", refreshToken);
             if (Check.isNull(resultJson)) {
                 log.error("快手刷新token返回结果为空,accountId:{}", accountId);
                 return;
@@ -203,5 +207,11 @@ public class CtopOauthTokenServiceImpl extends ServiceImpl<CtopOauthTokenMapper,
         return cTopOauthTokenMapper.getToutiaoTokenByCreateTime(createTime);
     }
 
+    private static Date addSecond(Date date, int seconds) {
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(date);
+        calendar.add(Calendar.SECOND, seconds);
+        return calendar.getTime();
+    }
 
 }

+ 16 - 8
module-common/src/main/java/cn/com/ctop/common/module/service/impl/RefreshTokenServiceImpl.java

@@ -26,23 +26,31 @@ public class RefreshTokenServiceImpl implements IRefreshTokenService {
      * @return
      */
     @Override
-    public void getRefresh() {
-        List<CtopOauthToken> oauthTokens = oauthTokenMapper.selectAll();
-        log.info("需要刷新token列表长度:{}", oauthTokens.size());
+    public void getKuaiShouRefresh() {
+        List<CtopOauthToken> oauthTokens = oauthTokenMapper.selectKuaiShouTokens(CtopAdConstant.PLATFORM_TYPE_KUAISHOU);
+
         if (!Check.isNull(oauthTokens)) {
             for (CtopOauthToken oauthToken : oauthTokens) {
                 log.info("刷新token,accountId:{}", oauthToken.getAccountId());
-                //头条
-                if (CtopAdConstant.PLATFORM_TYPE_BYTEDANCE.equals(oauthToken.getMediaId().trim())) {
-                    oauthTokenService.getByteDanceAccessToken(String.valueOf(oauthToken.getAccountId()));
-                }
                 //快手
                 if (CtopAdConstant.PLATFORM_TYPE_KUAISHOU.equals(oauthToken.getMediaId().trim())) {
-                    oauthTokenService.getKuaiShouRefreshToken(oauthToken.getAccountId(), oauthToken.getRefreshToken(), oauthToken.getAgentType());
+                    oauthTokenService.getKuaiShouRefreshToken(oauthToken.getAccountId(), oauthToken.getAccessToken(), oauthToken.getRefreshToken(), oauthToken.getAgentType());
                 }
             }
         } else {
             log.error("----------------------刷新token获取数据返回结果为空----------------------------------");
         }
     }
+
+    @Override
+    public void byteDanceRefresh() {
+        List<CtopOauthToken> byteDanceOauthTokens = oauthTokenMapper.selectByteDanceTokens(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE);
+        if (!Check.isNull(byteDanceOauthTokens)) {
+            for (CtopOauthToken oauthToken : byteDanceOauthTokens) {
+                oauthTokenService.getByteDanceAccessToken(oauthToken.getAccessToken(), oauthToken.getRefreshToken());
+
+            }
+        }
+
+    }
 }

+ 2 - 2
module-ctop/src/main/java/cn/com/ctop/manage/modules/material/service/impl/MaterialUploadServiceImpl.java

@@ -86,9 +86,9 @@ public class MaterialUploadServiceImpl implements IMaterialUploadService {
     @Override
     public void uploadAccount(String mediaId, JSONArray materialArray, JSONArray accountArray, String userId) {
         try {
-            if ("2".equals(mediaId)) {
+            if ("2".equals(mediaId) || "4".equals(mediaId)) {
                 this.kuaiShouUpload(mediaId, materialArray, accountArray, userId);
-            } else if ("1".equals(mediaId)) {
+            } else if ("1".equals(mediaId) || "3".equals(mediaId)) {
                 this.touTiaoUpload(mediaId, materialArray, accountArray, userId);
             }
         } catch (Exception e) {