下载七牛云扩展包
public function imgCheck() {
$img = 'https://dfzximg02.dftoutiao.com/news/20211130/20211130101706_5ad7e99f7be13bc9e7d427bb43577a70_1_mwpm_03201609.jpeg';
$auth = new Auth(config('ak'), config('sk'));
$method = 'POST';
$contentType = 'application/json';
$scenes = [
'censor' => ['pulp', 'terror', 'politician', 'ads'],
'pulp' => ['pulp'],
'terror' => ['terror'],
'politician' => ['politician'],
'ads' => ['ads']
];
$body = [
'data' => ['uri' => $img],
'params' => ['scenes' => $scenes['censor']]
];
$headers = $auth->authorizationV2(config('url'), $method, json_encode($body), $contentType);
$headers['Content-Type'] = $contentType;
$headers['Host'] = config('host');
$res = Client::post(config('url'), json_encode($body), $headers);
}