diff --git a/web/controllers/common/CommonUploadPic.rest.go b/web/controllers/common/CommonUploadPic.rest.go index affeca4..8c542d6 100644 --- a/web/controllers/common/CommonUploadPic.rest.go +++ b/web/controllers/common/CommonUploadPic.rest.go @@ -56,9 +56,11 @@ func RegisterUploadMustPic(party router.Party, httpMethod string, path string, m var uploadfiles []string for _, file := range files { if !utils.ValueIsEmpty(file.Filename) { + filename := strings.Split(file.Filename,".") + filetype := filename[1] guid := utils.MakeOrderSn(user.Userid) - filPath := "public/uploadfile/" + guid + ".jpg" - savePath := "web/public/uploadfile/" + guid + ".jpg" + filPath := "public/uploadfile/" + guid + "." +filetype + savePath := "web/public/uploadfile/" + guid + "." +filetype // 上传文件至指定目录 err := utils.SaveUploadedFile(file, savePath) if err != nil {