|
|
@@ -26,11 +26,12 @@ func ImgUpload(c *gin.Context) { |
|
|
|
e.OutErr(c, 400, err.Error()) |
|
|
|
return |
|
|
|
} |
|
|
|
uri := "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token" + token + "&type=image" |
|
|
|
postFile, err := utils.PostFile("media", res["fileName"], uri) |
|
|
|
fmt.Println(postFile) |
|
|
|
fmt.Println(token) |
|
|
|
uri := "https://api.weixin.qq.com/cgi-bin/material/add_material?access_token=" + token + "&type=image" |
|
|
|
postFile, err := utils.PostFile("media", fileStr, uri) |
|
|
|
fmt.Println(string(postFile)) |
|
|
|
fmt.Println(err) |
|
|
|
res["media_id"] = gjson.Get(string(postFile), "media_id").String() |
|
|
|
res["mediaId"] = gjson.Get(string(postFile), "media_id").String() |
|
|
|
e.OutSuc(c, res, nil) |
|
|
|
return |
|
|
|
} |