$img=$_POST['image'];
$newname=time().rand(10000,9999999);
$new_file="./imgs/".$newname.".png";
file_put_contents($new_file, base64_decode($img));
$tk=$this->token55(); //获取token
$url= "https://api.weixin.qq.com/wxa/media_check_async?access_token=".$tk;
$openid=I('openid');//post过来的openid
$imgurl="https://我的域名/imgs/".$newname.".png";
$arr=array(
"version"=>2,
"openid"=>"$openid",
"media_type"=>2,
"scene"=>2,
"media_url"=>$imgurl,
);
$d=json_encode($arr,JSON_UNESCAPED_UNICODE);
var_dump($d);
$res=$this->httpRequest($url,$d);
$res=json_decode($res,true);
返回值 $res:
array(3) {
["errcode"] => int(0)
["errmsg"] => string(2) "ok"
["trace_id"] => string(26) "63774cde-072da914-29b3d2be"}
怎么无论什么图片都是这样返回,没有result
这个接口是异步返回检测结果。https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/sec-center/sec-check/mediaCheckAsync.html