public function set_kf_avatar($kf_account, $path)
{
$url = self::API_DOMAIN . 'customservice/kfaccount/uploadheadimg?access_token=' . $this->get_access_token() . '&kf_account=' . $kf_account;
$res = HttpCurl::post($url, array('media' => '@' . $path), 'json');
// 异常处理: 获取时网络错误
if ($res === false) {
return Error::code('ERR_GET');
}
// 判断是否调用成功
if ($res->errcode == 0) {
return array(null, true);
} else {
return array($res, null);
}
}