diff --git a/webapp/controller/KefuController.class.php b/webapp/controller/KefuController.class.php index 5533b8c..155c5a9 100644 --- a/webapp/controller/KefuController.class.php +++ b/webapp/controller/KefuController.class.php @@ -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 . ':');