From 433e7b4311bf0d5fd603db33649a992ee36fba92 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 23 Feb 2022 18:49:53 +0800 Subject: [PATCH] cos update --- internal/common/cos.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/common/cos.go b/internal/common/cos.go index 37d2b2b21..4349cb68e 100644 --- a/internal/common/cos.go +++ b/internal/common/cos.go @@ -4,9 +4,8 @@ import ( "context" "errors" "fmt" - "open_im_sdk/pkg/log" - "open_im_sdk/pkg/constant" + "open_im_sdk/pkg/log" "github.com/tencentyun/cos-go-sdk-v5" "math/rand" @@ -78,10 +77,10 @@ func (c *COS) getNewFileNameAndContentType(filePath string, fileType string) (st func (c *COS) uploadObj(filePath string, fileType string, onProgressFun func(int)) (string, string, error) { COSResp, err := c.tencentCOSCredentials() - log.Info("upload ", COSResp.Credentials.SessionToken, "bucket ", COSResp.Credentials.TmpSecretID) if err != nil { return "", "", utils.Wrap(err, "") } + log.Info("upload ", COSResp.Credentials.SessionToken, "bucket ", COSResp.Credentials.TmpSecretID) dir := fmt.Sprintf("https://%s.cos.%s.myqcloud.com", COSResp.Bucket, COSResp.Region) u, _ := url.Parse(dir) b := &cos.BaseURL{BucketURL: u}