1
This commit is contained in:
parent
d4c59408d8
commit
6ad5abc7cc
@ -212,7 +212,7 @@ class KefuController {
|
|||||||
{
|
{
|
||||||
$gameid = phpcommon\extractGameId($accountid);
|
$gameid = phpcommon\extractGameId($accountid);
|
||||||
$access_token = $this->getAccessToken($gameid);
|
$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 = '';
|
$response = '';
|
||||||
if (!phpcommon\HttpClient::post($url,
|
if (!phpcommon\HttpClient::post($url,
|
||||||
@ -224,7 +224,7 @@ class KefuController {
|
|||||||
}
|
}
|
||||||
$ret_info = json_decode($response, true);
|
$ret_info = json_decode($response, true);
|
||||||
error_log(json_encode($response));
|
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');
|
error_log('重新获取access_token');
|
||||||
$r = $this->getRedis($gameid);
|
$r = $this->getRedis($gameid);
|
||||||
$r->del('kf_token:' . $gameid . ':');
|
$r->del('kf_token:' . $gameid . ':');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user