add clear
This commit is contained in:
@@ -32,7 +32,9 @@ class SecCheck extends SmallProgram
|
||||
return $this->sendError('文件不存在', 404);
|
||||
}
|
||||
$this->request->setUseSwoole(false);
|
||||
$this->request->setHeader(['Content-Type' => 'multipart/form-data']);
|
||||
$this->request->setHeader('Content-Type', 'multipart/form-data');
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
return $this->request->post($this->_url . $this->config->getAccessToken(), ['media' => new \CURLFile($path)]);
|
||||
}
|
||||
|
||||
@@ -48,7 +50,9 @@ class SecCheck extends SmallProgram
|
||||
if (!in_array($type, [self::MEDIA_IMAGE, self::MEDIA_VIDEO])) {
|
||||
throw new \Exception('暂不支持的文件类型');
|
||||
}
|
||||
$this->request->setHeader(['Content-Type' => 'application/json']);
|
||||
$this->request->setHeader('Content-Type', 'application/json');
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
$response = $this->request->post($this->_mediaCheckAsync . $this->config->getAccessToken(), [
|
||||
'media_url' => $url,
|
||||
'media_type' => $type
|
||||
@@ -79,7 +83,9 @@ class SecCheck extends SmallProgram
|
||||
if (empty($content)) {
|
||||
return $this->sendError('文件不存在', 404);
|
||||
}
|
||||
$this->request->setHeader(['Content-Type' => 'application/json']);
|
||||
$this->request->setHeader('Content-Type', 'application/json');
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
return $this->request->post($this->_msgUrl . $this->config->getAccessToken(), ['content' => $content]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user