callGetApi($url); } /** * 新增图片素材 * @param array $data * @return array * @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\LocalCacheException */ public function upload($filename) { $url = 'https://api.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=image'; return $this->callPostApi($url, ['media' => Tools::createCurlFile($filename)], false); } }