This commit is contained in:
aozhiwei 2019-08-19 20:20:33 +08:00
parent d4c59408d8
commit 6ad5abc7cc

View File

@ -212,7 +212,7 @@ class KefuController {
{
$gameid = phpcommon\extractGameId($accountid);
$access_token = $this->getAccessToken($gameid);
$url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=$access_token";
$url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" . urlencode($access_token);
$response = '';
if (!phpcommon\HttpClient::post($url,
@ -224,7 +224,7 @@ class KefuController {
}
$ret_info = json_decode($response, true);
error_log(json_encode($response));
if (isset($ret_info['errcode']) && $ret_info['errcode'] == 40001) {
if (isset($ret_info['errcode']) && ($ret_info['errcode'] == 40001 || $ret_info['errcode'] == 40003)) {
error_log('重新获取access_token');
$r = $this->getRedis($gameid);
$r->del('kf_token:' . $gameid . ':');