1 Star 0 Fork 0

h79/gothird

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
image.go 710 Bytes
一键复制 编辑 原始数据 按行查看 历史
huqiuyun 提交于 2023-07-25 17:58 . 把token放到 goutils
package security
import (
"encoding/json"
"fmt"
"gitee.com/h79/gothird/weixin/consts"
"gitee.com/h79/gothird/weixin/media"
"gitee.com/h79/gothird/weixin/response"
"gitee.com/h79/goutils/common/http"
"gitee.com/h79/goutils/token"
)
//POST https://api.weixin.qq.com/wxa/img_sec_check?access_token=ACCESS_TOKEN
func Image(api *token.Api, filename string) error {
uri := fmt.Sprintf("%s/wxa/img_sec_check?", consts.ApiPrefixUrl)
var img = media.Image{
FileName: filename,
}
var res = response.Response{}
er := api.Upload(uri, "media", &img, func(hp *http.Http, body []byte) error {
if err := json.Unmarshal(body, &res); err != nil {
return err
}
return res.ReturnIf(api)
})
return er
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/h79/gothird.git
git@gitee.com:h79/gothird.git
h79
gothird
gothird
v1.8.4

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385