Browse Source

文件上传增加错误信息返回

Former-commit-id: 474a2bc77b
pull/9/head
zhangwei 2 years ago
parent
commit
597ffb1489
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      adaptor/PCM-CORE/api/internal/handler/image/uploadhandler.go

+ 5
- 0
adaptor/PCM-CORE/api/internal/handler/image/uploadhandler.go View File

@@ -25,6 +25,11 @@ var uploadTempPath = filepath.Join(uploadPath, "temp")
func UploadHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
file, fileHeader, err := r.FormFile("file")
if err != nil {
logx.Error(err)
result2.HttpResult(r, w, nil, err)
return
}
index := r.PostFormValue("index")
hash := r.PostFormValue("hash")



Loading…
Cancel
Save