lyhzzz 2 лет назад
Родитель
Сommit
e31082372e

+ 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());