|
|
|
@ -324,15 +324,13 @@ 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(); |
|
|
|
|
$list = []; |
|
|
|
|
if ($token) { |
|
|
|
|
$url = 'https://api.weixin.qq.com/wxa/gettemplatelist?access_token=' . $token; |
|
|
|
|
return [$url]; |
|
|
|
|
$data['template_type'] = 1; |
|
|
|
|
$result = $this->curlGet($url, $data); |
|
|
|
|
$url = 'https://api.weixin.qq.com/wxa/gettemplatelist?access_token=' . $token . '&template_type=1'; |
|
|
|
|
$result = $this->curlGet($url); |
|
|
|
|
$result = json_decode($result, true); |
|
|
|
|
return $result; |
|
|
|
|
if ($result && !empty($result['template_list'])) { |
|
|
|
|