1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-13 17:22:26 +08:00

Compare commits

..

2 Commits

Author SHA1 Message Date
_oah
3b888ddbf5 Merge remote-tracking branch 'origin/feature_add_stream_upload' into feature_add_stream_upload
# Conflicts:
#	officialaccount/material/media.go
2024-07-16 23:35:37 +08:00
_oah
afaa30759a 新增支持流的形式上传方式 2024-07-16 23:32:16 +08:00

View File

@@ -51,7 +51,7 @@ func (material *Material) MediaUpload(mediaType MediaType, url string) (media Me
lastSlashIndex := strings.LastIndex(url, "/")
// 从最后一个斜杠的位置截取到最后,获取文件名
filename := url[lastSlashIndex+1:]
// 获取图片
// 获取资源
resp, err := http.Get(url)
if err != nil {
err = fmt.Errorf("get image error: %v", err)