瀏覽代碼

update

master
shenjiachi 1 周之前
父節點
當前提交
07a2fd1ef3
共有 1 個檔案被更改,包括 2 行新增3 行删除
  1. +2
    -3
      app/hdl/comm/hdl_comm.go

+ 2
- 3
app/hdl/comm/hdl_comm.go 查看文件

@@ -227,13 +227,13 @@ func GetSTSVoucher(c *gin.Context) {
for _, cfg := range *sysCfgs {
cfgMap[cfg.Key] = cfg.Val
}
endpoint := cfgMap[enum2.AliyunOssEndpoint]

redisKey := STSVoucherRedisKey
redisValue, err := cache.GetString(redisKey)
if err != nil {
if err.Error() == "redigo: nil returned" {

endpoint := cfgMap[enum2.AliyunOssEndpoint]
assumeRoleAccessKeyID := cfgMap[enum2.AliyunOssAssumeRoleAccessKeyID]
assumeRoleAccessKeySecret := cfgMap[enum2.AliyunOssAssumeRoleAccessKeySecret]
assumeRoleARN := cfgMap[enum2.AliyunOssAssumeRoleARN]
@@ -249,7 +249,6 @@ func GetSTSVoucher(c *gin.Context) {
}

roleArn := assumeRoleARN
fmt.Println(roleArn)
durationSeconds := 3600

assumeRoleResponse, err := svc.AssumeRole(client, &roleArn, &roleSessionName, int64(durationSeconds))
@@ -287,7 +286,7 @@ func GetSTSVoucher(c *gin.Context) {
var credentials sts20150401.AssumeRoleResponseBodyCredentials
utils.Unserialize([]byte(redisValue), &credentials)
bucket := cfgMap[enum2.AliyunOssBucketName]
region := strings.Split(bucket, ".")[0]
region := strings.Split(endpoint, ".")[0]

resp := GetSTSVoucherResp{
STSToken: credentials,


Loading…
取消
儲存