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, "")