From 1f138a75dd42d8ac68de349693468c5a78d4f047 Mon Sep 17 00:00:00 2001 From: "Mr. Lan" Date: Thu, 24 Sep 2020 23:12:39 +0800 Subject: [PATCH 1/3] fix: update readme. --- README.md | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 067e1c2..9ee0dc0 100644 --- a/README.md +++ b/README.md @@ -117,27 +117,36 @@ QQ群:1127401830 微信: -* 王* 1元 -* p*i 1元 -* LJ 10元 -* 吻住,我们能赢 10.24元 -* *悟 3元 -* Super_z 10元 -* T*i 10元 -* *伟 10元 -* 老白@天智 20元 -* 劉鑫 30元 +| 昵称 | 金额 | +| :---- | :---- | +| KAKA | 100元 | +| 劉鑫 | 30元 | +| 老白@天智 | 20元 | +| 吻住,我们能赢 | 10.24元 | +| LJ | 10.24元 | +| Super_z | 10元 | +| T*i | 10元 | +| *伟 | 10元 | +| *伟 | 10元 | +| *上 | 5元 | +| *悟 | 3元 | +| 王* | 1元 | +| p*i | 1元 | 支付宝: -* **英 10元 -* *城 5元 -* **华 1元 +| 昵称 | 金额 | +| :---- | :---- | +|**英 |10元| +|**华 |5元| +|*城 |1元| 其他: -* everstar_l 10元 -* 五色花 20元 +| 昵称 | 金额 | +| :---- | :---- | +|五色花 |20元| +|everstar_l |10元| ## 鸣谢 From 69818f10e7f5720e6e381b6c56e11fd327ae4381 Mon Sep 17 00:00:00 2001 From: "Mr. Lan" Date: Sun, 27 Sep 2020 02:51:27 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8E=A5=E5=8F=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apis/public/file.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/apis/public/file.go b/apis/public/file.go index 773868d..b3b9e3c 100644 --- a/apis/public/file.go +++ b/apis/public/file.go @@ -3,7 +3,6 @@ package public import ( "encoding/base64" "errors" - "ferry/pkg/utils" "ferry/tools/app" "fmt" "io/ioutil" @@ -71,6 +70,8 @@ func UploadFile(c *gin.Context) { } } + guid := strings.ReplaceAll(uuid.New().String(), "-", "") + switch tag { case "1": // 单图 files, err := c.FormFile("file") @@ -79,9 +80,7 @@ func UploadFile(c *gin.Context) { return } // 上传文件至指定目录 - guid := uuid.New().String() - - singleFile := saveFilePath + guid + utils.GetExt(files.Filename) + singleFile := saveFilePath + guid + "-" + files.Filename _ = c.SaveUploadedFile(files, singleFile) app.OK(c, urlPrefix+singleFile, "上传成功") return @@ -89,8 +88,8 @@ func UploadFile(c *gin.Context) { files := c.Request.MultipartForm.File["file"] multipartFile := make([]string, len(files)) for _, f := range files { - guid := uuid.New().String() - multipartFileName := saveFilePath + guid + utils.GetExt(f.Filename) + guid = strings.ReplaceAll(uuid.New().String(), "-", "") + multipartFileName := saveFilePath + guid + "-" + f.Filename _ = c.SaveUploadedFile(f, multipartFileName) multipartFile = append(multipartFile, urlPrefix+multipartFileName) } @@ -99,7 +98,6 @@ func UploadFile(c *gin.Context) { case "3": // base64 files, _ := c.GetPostForm("file") ddd, _ := base64.StdEncoding.DecodeString(files) - guid := uuid.New().String() _ = ioutil.WriteFile(saveFilePath+guid+".jpg", ddd, 0666) app.OK(c, urlPrefix+saveFilePath+guid+".jpg", "上传成功") default: From c63fe7753c3911c6b004170b363013b97178eb0d Mon Sep 17 00:00:00 2001 From: "Mr. Lan" Date: Sun, 27 Sep 2020 02:53:54 +0800 Subject: [PATCH 3/3] fix: update readme. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9ee0dc0..6c8f58e 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ QQ群:1127401830 | *伟 | 10元 | | *伟 | 10元 | | *上 | 5元 | +| *Sam . Chai | 5元 | | *悟 | 3元 | | 王* | 1元 | | p*i | 1元 | @@ -137,6 +138,7 @@ QQ群:1127401830 | 昵称 | 金额 | | :---- | :---- | +|**宝 |66元| |**英 |10元| |**华 |5元| |*城 |1元|