From b964e424b2fd68d011e3f68176d0e7a423a53d81 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Wed, 11 May 2022 10:47:32 +0800 Subject: [PATCH] update app --- internal/api/third/minio_storage_credential.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/third/minio_storage_credential.go b/internal/api/third/minio_storage_credential.go index 6f48dc3c3..06b01464f 100644 --- a/internal/api/third/minio_storage_credential.go +++ b/internal/api/third/minio_storage_credential.go @@ -173,7 +173,7 @@ func UploadUpdateApp(c *gin.Context) { c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "Open file error" + err.Error()}) return } - _, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, req.File.Filename, fileObj, req.File.Size, minio.PutObjectOptions{ContentType: path.Ext(newFileName)}) + _, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, req.File.Filename, fileObj, req.File.Size, minio.PutObjectOptions{ContentType: path.Ext(req.File.Filename)}) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "PutObject file error") c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "PutObject file error" + err.Error()}) @@ -182,7 +182,7 @@ func UploadUpdateApp(c *gin.Context) { if yamlName != "" { yamlObj, err := req.Yaml.Open() if err == nil { - _, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, yamlName, yamlObj, req.Yaml.Size, minio.PutObjectOptions{ContentType: path.Ext(newYamlName)}) + _, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, yamlName, yamlObj, req.Yaml.Size, minio.PutObjectOptions{ContentType: path.Ext(yamlName)}) if err != nil { log.NewError(req.OperationID, utils.GetSelfFuncName(), "PutObject yaml error") c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "PutObject yaml error" + err.Error()})