From e960783f5bd8ebe2dedd34110c7e6a83b6f073b8 Mon Sep 17 00:00:00 2001 From: junleea <354425203@qq.com> Date: Mon, 7 Apr 2025 19:22:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E4=BD=9Cppt=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E5=B7=B2=E5=AD=98=E5=9C=A8=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=97=B4=E6=88=B3=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=87=8D=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/fileService.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service/fileService.go b/service/fileService.go index a52a5c0..44dc0e6 100644 --- a/service/fileService.go +++ b/service/fileService.go @@ -253,7 +253,10 @@ func CreateUserFile(userID int, fileAuthName string, fileID int, UploadType stri log.Println("file auth name already exist, please change another name: ", fileAuthName) //将要保存的文件名改为fileAuthName+uuid strs := strings.Split(fileAuth.UserFileName, ".") - fileAuthName = strs[0] + "_1." + strs[1] + //当前时间戳 + timestamp := time.Now().Unix() + timestampStr := fmt.Sprintf("%d", timestamp) + fileAuthName = strs[0] + "_" + timestampStr + "." + strs[1] //return fileAuth } fileAuth_ := dao.CreateFileAuth(userID, fileID, fileAuthName, UploadType, 1, "")