From cefc3f36d07b0d451581bf54139ec06cb1573f31 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 29 Jan 2019 16:30:59 +0800 Subject: [PATCH] 1 --- webapp/controller/KefuController.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webapp/controller/KefuController.class.php b/webapp/controller/KefuController.class.php index 9fa147d..6687799 100644 --- a/webapp/controller/KefuController.class.php +++ b/webapp/controller/KefuController.class.php @@ -320,12 +320,12 @@ class KefuController { private function getAccessToken($accountid) { - $r = $this->getRedis($accountid); - $access_token = $r->get('kf_token:' . $accountid . ':'); + $gameid = phpcommon\extractGameId($accountid); + $r = $this->getRedis($gameid); + $access_token = $r->get('kf_token:' . $gameid . ':'); if (!empty($access_token)) { return $access_token; } - $gameid = phpcommon\extractGameId($accountid); $config_name = "../config/game$gameid/weixin/config.php"; @require $config_name; @@ -342,8 +342,8 @@ class KefuController { } $respobj = json_decode($response, true); if (isset($respobj['access_token'])) { - $r->set('kf_token:' . $accountid . ':', $respobj['access_token']); - $r->pexpire('kf_token:' . $accountid . ':', 1000 * ($respobj['expires_in'] - 60 * 1)); + $r->set('kf_token:' . $gameid . ':', $respobj['access_token']); + $r->pexpire('kf_token:' . $gameid . ':', 1000 * ($respobj['expires_in'] - 60 * 1)); return $respobj['access_token']; } else { return '';