|
@@ -117,6 +117,10 @@ type STSToken struct {
|
|
|
AccessKeySecret string
|
|
|
SecurityToken string
|
|
|
ExpiredTime string
|
|
|
+ RegionId string
|
|
|
+ Bucketname string
|
|
|
+ Endpoint string
|
|
|
+ Imghost string
|
|
|
}
|
|
|
|
|
|
// GetOssSTSToken 获取STSToken
|
|
@@ -148,6 +152,10 @@ func GetOssSTSToken() (item *STSToken, err error) {
|
|
|
item.AccessKeySecret = lastToken.AccessKeySecret
|
|
|
item.SecurityToken = lastToken.SecurityToken
|
|
|
item.ExpiredTime = lastToken.ExpiredTime
|
|
|
+ item.RegionId = utils.RegionId
|
|
|
+ item.Bucketname = utils.Bucketname
|
|
|
+ item.Endpoint = utils.Endpoint
|
|
|
+ item.Imghost = utils.Imghost
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -204,6 +212,10 @@ func NewSTSToken() (item *STSToken, err error) {
|
|
|
t, _ := time.Parse(time.RFC3339, response.Credentials.Expiration)
|
|
|
expiration := t.In(time.Local)
|
|
|
item.ExpiredTime = expiration.Format(utils.FormatDateTime)
|
|
|
+ item.RegionId = utils.RegionId
|
|
|
+ item.Bucketname = utils.Bucketname
|
|
|
+ item.Endpoint = utils.Endpoint
|
|
|
+ item.Imghost = utils.Imghost
|
|
|
}
|
|
|
return
|
|
|
}
|