From 07a2fd1ef3b76c0bec6ebe63a02960944e253208 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 5 Dec 2024 09:38:52 +0800 Subject: [PATCH] update --- app/hdl/comm/hdl_comm.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/hdl/comm/hdl_comm.go b/app/hdl/comm/hdl_comm.go index 346d4a8..1589179 100644 --- a/app/hdl/comm/hdl_comm.go +++ b/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,