From 697341f823e851b1fadbeceab9a918eca02864d5 Mon Sep 17 00:00:00 2001 From: coward Date: Fri, 5 Jul 2024 14:52:28 +0800 Subject: [PATCH] =?UTF-8?q?:art:=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/file_system.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/utils/file_system.go b/utils/file_system.go index 8bf9e8b..6676779 100644 --- a/utils/file_system.go +++ b/utils/file_system.go @@ -29,7 +29,7 @@ func (fileSystem) UploadFile(file []byte, suffix string) (filePath string, err e return "", err } - return ossObj.LongPath, nil + filePath = ossObj.LongPath case "local": filePath = fmt.Sprintf("%v/%d-avatar%s", config.Config.File.Path, time.Now().Unix(), suffix) // 创建目录 @@ -40,8 +40,6 @@ func (fileSystem) UploadFile(file []byte, suffix string) (filePath string, err e if err = os.WriteFile(filePath, file, os.FileMode(0777)); err != nil { return "", err } - - return filePath, nil } - return "", nil + return filePath, err }