liufumingren d63dfcfcd7 1
2026-09-10 14:39:58 +08:00

31 lines
865 B
PHP

<?php
namespace app\index\library\qiwe;
use Exception;
use fast\Http;
use \app\index\library\qiwe\Apis;
class Query
{
public function __construct($options = []){
$this->tokenId = $options['tokenId'];
//$this->guid = $options['guid'];
}
//
public function query($method,$args){
$url = "https://new.qiweapi.com/qiwe/api/qw/doApi";
$header = [
'Content-Type: application/json; charset=UTF-8',
"X-QIWEI-TOKEN:{$this->tokenId}",
];
$options = [
CURLOPT_HTTPHEADER => $header
];
$body = json_encode(Apis::$method($args));
\think\Log::error('请求参数: '.json_encode([$url, $body, 'POST', $options]));
$req = Http::sendRequest($url, $body, 'POST', $options);
$res = $req['ret'] ? $req['msg'] : '';
return $res;
}
}