Skip to content

Commit bb74076

Browse files
committed
ad
1 parent 5915227 commit bb74076

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"data":{"access_token":"E4GGvBcGuQvLPOAYZes6rL3NWClPBye3Q1UHxGP5E_FhdsbXFDQtfxRMM8jw7qnGDmwvxksgKQs9nXyGYy-CtcfeaHULaroiTib1TPrcFGf0G7zS_8vorVT-zBDrf4ZtCSRcAAAFVU","expires_in":7200},"expire":7100}

src/Wechat.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ public function __construct($config){
4949
$this->redirect_uri = $config['redirect_uri'];
5050
$this->access_token = $this->get_access_token();
5151

52-
require_once 'FileCache/src/FileCache.php';
53-
$this->Cache = new FileCache();
5452

5553
}
5654

@@ -229,7 +227,7 @@ public function get_auth_user($openid , $access_token , $lang = 'zh_CN'){
229227
*/
230228
public function return_data($data){
231229

232-
if ($data['errcode']){
230+
if (isset($data['errcode'])){
233231
$this->error = $data['errmsg'];
234232
return false;
235233
}else{
@@ -337,7 +335,9 @@ public function http_post($url, $fields, $data_type='json') {
337335
*/
338336
public function cache($key , $value = null , $expire = 3600){
339337

340-
$cache = $this->Cache;
338+
339+
require_once 'FileCache/src/FileCache.php';
340+
$cache = new FileCache();
341341

342342
if ($value){
343343
$result = $cache->set($key, $value , $expire);
@@ -351,7 +351,9 @@ public function cache($key , $value = null , $expire = 3600){
351351

352352
public function cacheClear($key = null){
353353

354-
$cache = $this->Cache;
354+
require_once 'FileCache/src/FileCache.php';
355+
$cache = new FileCache();
356+
355357
if ($key){
356358
$have = $cache->isHave($key);
357359
if ($have){

0 commit comments

Comments
 (0)