add clear
This commit is contained in:
@@ -50,6 +50,8 @@ class Account extends SmallProgram
|
||||
|
||||
$this->request->setMethod(HttpClient::GET);
|
||||
$this->request->addHeader('Content-Type', 'text/xml');
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
|
||||
return $this->request->get('sns/jscode2session', $param);
|
||||
}
|
||||
@@ -69,6 +71,8 @@ class Account extends SmallProgram
|
||||
|
||||
$this->request->setMethod(HttpClient::GET);
|
||||
$this->request->setIsSSL(true);
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
return $this->request->get($this->publicInfo, $query);
|
||||
}
|
||||
|
||||
@@ -114,6 +118,8 @@ class Account extends SmallProgram
|
||||
|
||||
$this->request->setMethod(HttpClient::POST);
|
||||
$this->request->setCallback([$this, 'saveByPath']);
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
|
||||
return $this->request->post($url, $sendBody);
|
||||
}
|
||||
@@ -142,6 +148,8 @@ class Account extends SmallProgram
|
||||
|
||||
$this->request->setMethod(HttpClient::POST);
|
||||
$this->request->setCallback([$this, 'saveByPath']);
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
return $this->request->post($url, $sendBody);
|
||||
}
|
||||
|
||||
@@ -169,6 +177,8 @@ class Account extends SmallProgram
|
||||
|
||||
$this->request->setMethod(HttpClient::POST);
|
||||
$this->request->setCallback([$this, 'saveByPath']);
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
return $this->request->post($url, $sendBody);
|
||||
}
|
||||
|
||||
|
||||
@@ -300,6 +300,8 @@ class Message extends SmallProgram
|
||||
|
||||
$url = '/cgi-bin/message/custom/send?access_token=' . $this->getAccessToken();
|
||||
$this->request->setMethod(HttpClient::POST);
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
|
||||
/** @var Result $body */
|
||||
$body = $this->request->post($url, $data);
|
||||
|
||||
@@ -147,7 +147,8 @@ class PublicTemplate extends SmallProgram
|
||||
|
||||
$this->request->setIsSSL(true);
|
||||
$this->request->addHeader('content-type', 'application/json');
|
||||
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
$result = $this->request->post($url, $params);
|
||||
$result->append('postBody', $params);
|
||||
|
||||
|
||||
@@ -175,6 +175,8 @@ class Recharge extends SmallProgram
|
||||
$this->request->setIsSSL(true);
|
||||
$this->request->setMethod(HttpClient::POST);
|
||||
$this->request->addHeader('Content-Type', 'text/xml');
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
return $this->request->send($url, $data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ class SmallProgram extends Miniprogarampage
|
||||
'appid' => $this->config->getAppid(),
|
||||
'secret' => $this->config->getAppsecret()
|
||||
];
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
$param = $this->request->get($this->url, $query);
|
||||
if (!$param->isResultsOK()) {
|
||||
throw new \Exception($param->getMessage());
|
||||
|
||||
@@ -125,6 +125,8 @@ class Subject extends SmallProgram
|
||||
$this->request->setIsSSL(true);
|
||||
$this->request->addHeader('content-type', 'application/json');
|
||||
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
$result = $this->request->post($url, $params);
|
||||
$result->append('postBody', $params);
|
||||
|
||||
|
||||
@@ -136,7 +136,8 @@ class Template extends SmallProgram
|
||||
|
||||
$this->request->setIsSSL(true);
|
||||
$this->request->addHeader('content-type', 'application/json');
|
||||
|
||||
$this->request->setErrorField('errcode');
|
||||
$this->request->setErrorMsgField('errmsg');
|
||||
$result = $this->request->post($url, $params);
|
||||
$result->append('postBody', $params);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user