Commit b024c0c5 authored by duanjinfei's avatar duanjinfei

update commit file cache

parent 730d8712
...@@ -2,7 +2,6 @@ package nm ...@@ -2,7 +2,6 @@ package nm
import ( import (
"bytes" "bytes"
"encoding/base64"
"encoding/json" "encoding/json"
"example.com/m/conf" "example.com/m/conf"
"example.com/m/log" "example.com/m/log"
...@@ -342,12 +341,13 @@ func (t *TaskHandler) uploadOSS(taskId string, queries string, base64Image strin ...@@ -342,12 +341,13 @@ func (t *TaskHandler) uploadOSS(taskId string, queries string, base64Image strin
return "", err return "", err
} }
// 将 base64 解码后的内容复制到表单字段 // 将 base64 解码后的内容复制到表单字段
decodedImage, err := base64.StdEncoding.DecodeString(base64Image) //decodedImage, err := base64.StdEncoding.DecodeString(base64Image)
if err != nil { //if err != nil {
log.WithError(err).Error("Error decoding base64 image") // log.WithError(err).Error("Error decoding base64 image")
return "", err // return "", err
} //}
_, err = io.Copy(fileField, bytes.NewReader(decodedImage)) //_, err = io.Copy(fileField, bytes.NewReader(decodedImage))
_, err = io.Copy(fileField, strings.NewReader(base64Image))
if err != nil { if err != nil {
log.WithError(err).Error("Error copying file contents") log.WithError(err).Error("Error copying file contents")
return "", err return "", err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment