lyhzzz 2 年之前
父节点
当前提交
e31082372e
共有 1 个文件被更改,包括 1 次插入3 次删除
  1. 1 3
      src/main/java/com/fdkankan/tk/service/impl/TencentYunServiceImpl.java

+ 1 - 3
src/main/java/com/fdkankan/tk/service/impl/TencentYunServiceImpl.java

@@ -69,8 +69,6 @@ public class TencentYunServiceImpl extends ServiceImpl<ITencentYunMapper, Tencen
         return this.list(wrapper);
     }
 
-    static int tokenExpirationInSeconds = 3600;
-    static int privilegeExpirationInSeconds = 3600;
 
     static HashMap<Integer,RtcTokenBuilder.Role> roleMap = new HashMap<>();
     private void setRoleMap (){
@@ -99,7 +97,7 @@ public class TencentYunServiceImpl extends ServiceImpl<ITencentYunMapper, Tencen
             }
             TencentYun tencentYun = list.get(0);
             RtcTokenBuilder token = new RtcTokenBuilder();
-            String result = token.buildTokenWithUid(tencentYun.getAppid(), tencentYun.getSecretkey(), channelName, userId,roleMap.get(roleId) ,privilegeExpirationInSeconds);
+            String result = token.buildTokenWithUid(tencentYun.getAppid(), tencentYun.getSecretkey(), channelName, userId,roleMap.get(roleId) ,tencentYun.getExTime());
             JSONObject jsonObject = new JSONObject();
             jsonObject.put("sdkAppId",tencentYun.getSdkAppid());
             jsonObject.put("expire",tencentYun.getExTime());