Token =new Token($this->clientId,$this->clientSecret); $this->Client=new Client($this->GetToken()); } public function GetData($method,$params=[]){ return $this->Client->post($method,$this->apiVersion, $params); } private function GetToken(){ $token = Cache::get("YouZanToken"); if(isset($token)&& $token!=""){ return $token['access_token']; } $token =$this->Token->getSelfAppToken($this->authorityId,["refresh"=>true]); Cache::set("YouZanToken",$token,3500); return $token['access_token']; } }