第三方平台上传永久素材返回48001
查了一下说是没有权限,请问我需要在哪里查看我的第三方平台的权限呢?
开发流程如下,后台添加图片,通过第三方平台的component_access_token
请求上传接口,但是一直返回48001
/** * 新增永久素材 * */ public function addImg($filename,$type,$filelength,$imgurl){ $file_info=array( 'filename'=>$filename, //图片相对于网站根目录的路径 'content-type'=>$type, //文件类型 'filelength'=>$filelength //图文大小 ); $real_path=$imgurl; $ImgList= $this->uploadImg($real_path,$file_info); $ImgList=json_decode($ImgList,true); if($ImgList['media_id']){ echo '图片上传成功!<br/>media_id:'.$ImgList['media_id']; }else{ dump($ImgList); } } //图片上传整合需要的东西 function uploadImg($imgUrl,$file_info){ $TOKEN = $this->get_component_access_token(); $URL ='https://api.weixin.qq.com/cgi-bin/material/add_material?access_token='.$TOKEN.'&type=image';//上传临时文件 $data = array( 'media'=>"@".$imgUrl, 'form-data' => $file_info ); $result = $this->http_post($URL,$data); $data = [@json_decode](/user/json_decode)($result,true); var_dump($URL); var_dump($result);exit; return $result; } |
返回结果如下
