|
@@ -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"));
|