wang hou sheng 8 months ago
parent b434f3bead
commit 038dd03899
  1. 16
      app/common/library/wxserver/Server.php

@ -226,8 +226,8 @@ class Server
*/ */
public function getTemplatedraftlist() public function getTemplatedraftlist()
{ {
if (Cache::has('templatedraftlist')) { if (Cache::has('wx_server_drafttemplatelist')) {
return Cache::get('templatedraftlist'); return Cache::get('wx_server_drafttemplatelist');
} }
$token = $this->getComponentAccessToken(); $token = $this->getComponentAccessToken();
$list = []; $list = [];
@ -245,7 +245,7 @@ class Server
'id' => $value['draft_id'], 'id' => $value['draft_id'],
]; ];
} }
Cache::set('templatelist', $list, 86400); Cache::set('wx_server_drafttemplatelist', $list, 86400);
} }
} }
return $list; return $list;
@ -274,7 +274,7 @@ class Server
$res = $this->curlPost($url, json_encode($data)); $res = $this->curlPost($url, json_encode($data));
$res = json_decode($res, true); $res = json_decode($res, true);
if ($res && !empty($res['errmsg']) && $res['errmsg'] == 'ok') { if ($res && !empty($res['errmsg']) && $res['errmsg'] == 'ok') {
Cache::delete('templatelist'); Cache::delete('wx_server_templatelist');
return true; return true;
} }
} }
@ -296,7 +296,7 @@ class Server
$res = $this->curlPost($url, json_encode($data)); $res = $this->curlPost($url, json_encode($data));
$res = json_decode($res, true); $res = json_decode($res, true);
if ($res && !empty($res['errmsg']) && $res['errmsg'] == 'ok') { if ($res && !empty($res['errmsg']) && $res['errmsg'] == 'ok') {
Cache::delete('templatelist'); Cache::delete('wx_server_templatelist');
return true; return true;
} }
} }
@ -310,8 +310,8 @@ class Server
*/ */
public function getTemplatelist(): array public function getTemplatelist(): array
{ {
if (Cache::has('templatelist')) { if (Cache::has('wx_server_templatelist')) {
return Cache::get('templatelist'); return Cache::get('wx_server_templatelist');
} }
$token = $this->getComponentAccessToken(); $token = $this->getComponentAccessToken();
$list = []; $list = [];
@ -334,7 +334,7 @@ class Server
'draft_id' => $value['draft_id'], 'draft_id' => $value['draft_id'],
]; ];
} }
Cache::set('templatelist', $list, 86400); Cache::set('wx_server_templatelist', $list, 86400);
} }
} }
return $list; return $list;

Loading…
Cancel
Save