mirror of
				https://gitee.com/zoujingli/WeChatDeveloper.git
				synced 2025-11-04 10:52:08 +08:00 
			
		
		
		
	[更新]增加客服头像上传
This commit is contained in:
		
							parent
							
								
									c47ccba31b
								
							
						
					
					
						commit
						ebefeda14f
					
				@ -15,6 +15,7 @@
 | 
			
		||||
namespace WeChat;
 | 
			
		||||
 | 
			
		||||
use WeChat\Contracts\BasicWeChat;
 | 
			
		||||
use WeChat\Contracts\Tools;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 客服消息处理
 | 
			
		||||
@ -87,6 +88,21 @@ class Custom extends BasicWeChat
 | 
			
		||||
        return $this->httpGetForJson($url);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 设置客服帐号的头像
 | 
			
		||||
     * @param string $kf_account 客户账号
 | 
			
		||||
     * @param string $image 头像文件位置
 | 
			
		||||
     * @return array
 | 
			
		||||
     * @throws Exceptions\InvalidResponseException
 | 
			
		||||
     * @throws Exceptions\LocalCacheException
 | 
			
		||||
     */
 | 
			
		||||
    public function uploadHeadimg($kf_account, $image)
 | 
			
		||||
    {
 | 
			
		||||
        $url = "http://api.weixin.qq.com/customservice/kfaccount/uploadheadimg?access_token=ACCESS_TOKEN&kf_account={$kf_account}";
 | 
			
		||||
        $this->registerApi($url, __FUNCTION__, func_get_args());
 | 
			
		||||
        return $this->httpPostForJson($url, ['media' => Tools::createCurlFile($image)]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 客服接口-发消息
 | 
			
		||||
     * @param array $data
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user