From ee1748d981b2906e974c038f8e83b28215a02de9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 16 Sep 2019 17:01:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E6=95=88openid?= =?UTF-8?q?=E7=8E=A9=E5=AE=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/controller/KefuController.class.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webapp/controller/KefuController.class.php b/webapp/controller/KefuController.class.php index 659fb67..6fa27e7 100644 --- a/webapp/controller/KefuController.class.php +++ b/webapp/controller/KefuController.class.php @@ -208,6 +208,17 @@ class KefuController { } } + protected function delOvertimeOpenid($accountid) + { + $conn = $this->getMysql($accountid); + error_log('del:' . $accountid); + $ret = $conn->execScript('DELETE FROM accounts ' . + 'WHERE accountid=:accountid;', + array( + ':accountid' => $accountid, + )); + } + private function sendKefuMsg($accountid, $data) { try { @@ -231,6 +242,7 @@ class KefuController { if ($ret_info['errcode'] == 40003) { //无效的openid,(更换appid appkey导致之前的openid失效) //从db里删除这种过期的openid + $this->delOvertimeOpenid($accountid); return true; } error_log('重新获取access_token');