Althars123 3 년 전
부모
커밋
f67adb43f6

+ 1 - 0
zzjs-admin/src/main/resources/application-dev.yml

@@ -105,6 +105,7 @@ cos:
     bucketName: zzjs-test-1305573081
     path: https://t1-1305573081.file.myqcloud.com
     preffix: t1
+    classId: 843437
 
 
 # 微信支付

+ 1 - 0
zzjs-admin/src/main/resources/application-prod.yml

@@ -105,6 +105,7 @@ cos:
     bucketName: t1-1305573081
     path: https://t1-1305573081.file.myqcloud.com
     preffix: t1
+    classId: 843436
 
 
 # 微信支付

+ 3 - 0
zzjs-common/src/main/java/com/miaxis/common/utils/VodSignature.java

@@ -14,6 +14,8 @@ public class VodSignature {
     private String secretId;
     @Value("${cos.secretKey}")
     private String secretKey;
+    @Value("${cos.classId}")
+    private String classId;
     private long effectTime =3600 * 24 * 2;
     private static final String HMAC_ALGORITHM = "HmacSHA1"; //签名算法
     private static final String CONTENT_CHARSET = "UTF-8";
@@ -30,6 +32,7 @@ public class VodSignature {
         // 生成原始参数字符串
         long endTime = (System.currentTimeMillis() / 1000 + effectTime);// 签名有效期:2天
         contextStr += "secretId=" + java.net.URLEncoder.encode(secretId, "utf8");
+        contextStr += "&classId=" + classId;
         contextStr += "&currentTimeStamp=" + System.currentTimeMillis() / 1000;
         contextStr += "&expireTime=" + endTime;
         contextStr += "&random=" + new Random().nextInt(java.lang.Integer.MAX_VALUE);