request->params([ ['type', ''], ]); return success((new WechatMediaService())->getMediaPage($data)); } /** * 上传图片素材 * @return \think\Response * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface */ public function image() { $data = $this->request->params([ ['file', 'file'], ]); return success((new WechatMediaService())->addImageMedia($data)); } /** * 上传视频素材 * @return \think\Response * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface */ public function video() { $data = $this->request->params([ ['file', 'file'], ]); return success((new WechatMediaService())->addVideoMedia($data)); } /** * 同步草稿箱 * @return \think\Response * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface */ public function syncNews() { return success((new WechatMediaService())->syncNewsMedia()); } }