easy-swoole / wechat

Wechat based on easyswoole.
82 stars 28 forks source link

小程序Application没有包含基础的 BasicService\Media\Client #152

Closed browningweb closed 2 years ago

browningweb commented 2 years ago

https://github.com/easy-swoole/wechat/blob/cee56dd04f66109171ebf3009ccb52d5c177313d/src/MiniProgram/Application.php#L40

小程序需要修改头像等接口时,需要先上传图片到微信服务器,这里需要 media 基础接口。

XueSiLf commented 2 years ago

media基础接口,请自行调用: 公众号提供的服务接口:https://github.com/easy-swoole/wechat/blob/2.x/src/OfficialAccount/Material/Client.php

browningweb commented 2 years ago

根据第三方平台文档,修改头像,里面的 media_id 需要是临时素材,用的接口是 新增临时素材,也就是你上面提到的接口 cgi-bin/media/upload

这个接口只出现在了 https://github.com/easy-swoole/wechat/blob/2.x/src/BasicService/Media/Client.php

暂时没有试 公众号提供的服务接口 https://github.com/easy-swoole/wechat/blob/2.x/src/OfficialAccount/Material/Client.php 可不可以。

XueSiLf commented 2 years ago

按理是可以的

XueSiLf commented 2 years ago

抱歉,是我看错了,的确少了这个媒体客户端,已修复,详细请看 https://github.com/easy-swoole/wechat/pull/166