wugg 4 months ago
parent
commit
73979220fd
2 changed files with 3 additions and 3 deletions
  1. 2 2
      app/common/Youzan.php
  2. 1 1
      app/youzan/controller/Voucher.php

+ 2 - 2
app/common/Youzan.php

@@ -56,9 +56,9 @@ class Youzan {
     }
 
     public function getToken(){
-        $cache =cache::store("redis2");
+        $cache =Cache::store("redis2");
         $token = $cache->get('YouZanToken'.$this->authorityId);
-        if(!isset($token['access_token'])|| $token['access_token']!=''){
+        if(!isset($token['access_token'])|| $token['access_token']==''){
             $yzToken = new \Youzan\Open\Token($this->clientId,$this->clientSecret);
             $token =$yzToken->getSelfAppToken($this->authorityId,['refresh'=>true]);
            $cache->set('YouZanToken'.$this->authorityId,$token,(new \DateTime($token['expires']/100))->format("Y-m-d H:i:s"));

+ 1 - 1
app/youzan/controller/Voucher.php

@@ -4,7 +4,7 @@
 namespace app\youzan\controller;
 
 
-use app\common\facade\Youzan;use think\App;
+use app\common\facade\Youzan;use think\App;use think\facade\Cache;
 class Voucher extends Base{
 
     public function __construct(App $app) {