12345678910111213141516171819202122232425262728 |
- <?php
- namespace app\admin\common;
- use Youzan\Open\Client;
- use Youzan\Open\Token;
- class YouZan
- {
- public $Client;
- public $Token;
- public $clientId='deaaebe6484c129787';
- public $clientSecret='3c654aa2fbc1b5da788ffdba45fb96f0';
- public function __construct()
- {
- $this->Token =new Token($this->clientId,$this->clientSecret);
- $this->Client=new Client($this->GetToken());
- }
- public function GetData($method,$apiVersion,$params){
- return $this->Client->post($method, $apiVersion, $params);
- }
- public function GetToken(){
- return $this->Token->getSelfAppToken("silent",["refresh"=>true]);
- }
- }
|