以下以淘宝客sdk为例
把淘宝客sdk放在extend文件夹下,然后在控制器中调用 [cc lang="php"]namespace app\controller; require_once '../extend/tbk/TopSdk.php'; class Tbkapi { public function index() { $c = new \TopClient; $c->appkey = 'appkey'; $c->secretKey = 'secretKey'; $req = new \TbkDgMaterialOptionalRequest; $req->setQ("女装"); $req->setAdzoneId(446363); $resp = $c->execute($req); //print_r($resp); return json($resp); } }[/cc]如需转载请保留本文出处: https://zhe94.com/651.html