作者 唐旭辉

调整文件存储

@@ -58,7 +58,7 @@ func saveFile(fileData *multipart.FileHeader, fileType string) (hostpath string, @@ -58,7 +58,7 @@ func saveFile(fileData *multipart.FileHeader, fileType string) (hostpath string,
58 } 58 }
59 subfix := path.Ext(fileData.Filename) 59 subfix := path.Ext(fileData.Filename)
60 mfileName := fmt.Sprint(utils.GenerateIDBySonyflake()) 60 mfileName := fmt.Sprint(utils.GenerateIDBySonyflake())
61 - mfileName = fmt.Sprintf("%d_%s.%s", time.Now().Unix(), mfileName, subfix) 61 + mfileName = fmt.Sprintf("%d_%s%s", time.Now().Unix(), mfileName, subfix)
62 log.Debug("文件保存地址%s", filepath.Join(savepath, mfileName)) 62 log.Debug("文件保存地址%s", filepath.Join(savepath, mfileName))
63 dst, err := os.Create(filepath.Join(savepath, mfileName)) 63 dst, err := os.Create(filepath.Join(savepath, mfileName))
64 defer dst.Close() 64 defer dst.Close()