From e4f8e5b70943656c69bfcc93da3822599c9eaab6 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Tue, 9 Apr 2024 11:55:28 +0800 Subject: [PATCH] 1 --- app/common/library/wxserver/Server.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/common/library/wxserver/Server.php b/app/common/library/wxserver/Server.php index 4be91951..b4e6e9e9 100644 --- a/app/common/library/wxserver/Server.php +++ b/app/common/library/wxserver/Server.php @@ -66,8 +66,8 @@ class Server */ public function getComponentAccessToken() { - if (Cache::has('ComponentAccessToken')) { - return Cache::get('ComponentAccessToken'); + if (Cache::has('wxserver_component_access_token')) { + return Cache::get('wxserver_component_access_token'); } $url = 'https://api.weixin.qq.com/cgi-bin/component/api_component_token'; $ticket = Cache::get('component_verify_ticket'); @@ -79,7 +79,7 @@ class Server $result = $this->curlPost($url, json_encode($data), 10); $result = json_decode($result, true); if (!empty($result['component_access_token'])) { - Cache::set('ComponentAccessToken', $result['component_access_token'], 6200); + Cache::set('wxserver_component_access_token', $result['component_access_token'], 6200); return $result['component_access_token']; } } @@ -324,9 +324,9 @@ class Server public function getTemplatelist(): array { if (Cache::has('wx_server_templatelist')) { - return Cache::get('wx_server_templatelist'); + //return Cache::get('wx_server_templatelist'); } - $token = $this->getStableAccessToken(); + $token = $this->getComponentAccessToken(); $list = []; if ($token) { $url = 'https://api.weixin.qq.com/wxa/gettemplatelist?access_token=' . $token . '&template_type=1';