Skip to content

Commit

Permalink
cos update
Browse files Browse the repository at this point in the history
  • Loading branch information
FGadvancer committed Feb 23, 2022
1 parent 992f76d commit 433e7b4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/common/cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 433e7b4

Please sign in to comment.