add clear

This commit is contained in:
2020-04-01 11:53:15 +08:00
parent 7eeaef4c3b
commit 9dd8ea2d0b
8 changed files with 31 additions and 5 deletions
+9 -3
View File
@@ -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]);
}