正在显示
1 个修改的文件
包含
5 行增加
和
5 行删除
@@ -28,8 +28,8 @@ func (this *UploadController) Image() { | @@ -28,8 +28,8 @@ func (this *UploadController) Image() { | ||
28 | var request = &protocol.FileRequest{} | 28 | var request = &protocol.FileRequest{} |
29 | if len(this.Ctx.Request.MultipartForm.File) != 0 { | 29 | if len(this.Ctx.Request.MultipartForm.File) != 0 { |
30 | var tmp *protocol.FileResponse | 30 | var tmp *protocol.FileResponse |
31 | - for _, v := range this.Ctx.Request.MultipartForm.File { | ||
32 | - request.Files = v | 31 | + for _, key := range upload.GetSortFileKeys(this.Ctx.Request.MultipartForm.File) { |
32 | + request.Files = this.Ctx.Request.MultipartForm.File[key] | ||
33 | if tmp, err = upload.Image(request); err != nil { | 33 | if tmp, err = upload.Image(request); err != nil { |
34 | log.Error(err) | 34 | log.Error(err) |
35 | return | 35 | return |
@@ -83,9 +83,9 @@ func (this *UploadController) Video() { | @@ -83,9 +83,9 @@ func (this *UploadController) Video() { | ||
83 | var request = &protocol.FileRequest{} | 83 | var request = &protocol.FileRequest{} |
84 | if len(this.Ctx.Request.MultipartForm.File) != 0 { | 84 | if len(this.Ctx.Request.MultipartForm.File) != 0 { |
85 | var tmp *protocol.FileResponse | 85 | var tmp *protocol.FileResponse |
86 | - for _, v := range this.Ctx.Request.MultipartForm.File { | ||
87 | - request.Files = v | ||
88 | - if tmp, err = upload.Voice(request); err != nil { | 86 | + for _, key := range upload.GetSortFileKeys(this.Ctx.Request.MultipartForm.File) { |
87 | + request.Files = this.Ctx.Request.MultipartForm.File[key] | ||
88 | + if tmp, err = upload.Video(request); err != nil { | ||
89 | log.Error(err) | 89 | log.Error(err) |
90 | return | 90 | return |
91 | } | 91 | } |
-
请 注册 或 登录 后发表评论