add clear

This commit is contained in:
as2252258@163.com
2020-03-16 19:16:32 +08:00
parent e572352208
commit 331dcaa325
+13 -43
View File
@@ -27,13 +27,10 @@ class Tag extends AfficialAccount
$config = $this->config->getAccessToken(); $config = $this->config->getAccessToken();
$result = $this->request->post($this->generate_url . $config, $params);
$this->request->setErrorField('errcode'); $this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg'); $this->request->setErrorMsgField('errmsg');
if (!$result->isResultsOK()) {
throw new \Exception($result->getMessage()); return $this->request->post($this->generate_url . $config, $params);
}
return $result->getData();
} }
/** /**
@@ -49,13 +46,11 @@ class Tag extends AfficialAccount
$config = $this->config->getAccessToken(); $config = $this->config->getAccessToken();
$result = $this->request->post($this->tag_edit . $config, $url);
$this->request->setErrorField('errcode'); $this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg'); $this->request->setErrorMsgField('errmsg');
if (!$result->isResultsOK()) {
throw new \Exception($result->getMessage()); return $this->request->post($this->tag_edit . $config, $url);
}
return $result->getData();
} }
@@ -70,14 +65,9 @@ class Tag extends AfficialAccount
$url['tag[id]'] = $id; $url['tag[id]'] = $id;
$config = $this->config->getAccessToken(); $config = $this->config->getAccessToken();
$result = $this->request->post($this->tag_delete . $config, $url);
$this->request->setErrorField('errcode'); $this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg'); $this->request->setErrorMsgField('errmsg');
if (!$result->isResultsOK()) { return $this->request->post($this->tag_delete . $config, $url);
throw new \Exception($result->getMessage());
}
return $result->getData();
} }
@@ -94,13 +84,9 @@ class Tag extends AfficialAccount
$config = $this->config->getAccessToken(); $config = $this->config->getAccessToken();
$result = $this->request->post($this->user_batch_add_tag . $config, $url);
$this->request->setErrorField('errcode'); $this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg'); $this->request->setErrorMsgField('errmsg');
if (!$result->isResultsOK()) { return $this->request->post($this->user_batch_add_tag . $config, $url);
throw new \Exception($result->getMessage());
}
return $result->getData();
} }
@@ -117,13 +103,9 @@ class Tag extends AfficialAccount
$config = $this->config->getAccessToken(); $config = $this->config->getAccessToken();
$result = $this->request->post($this->user_batch_remove_tag . $config, $url);
$this->request->setErrorField('errcode'); $this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg'); $this->request->setErrorMsgField('errmsg');
if (!$result->isResultsOK()) { return $this->request->post($this->user_batch_remove_tag . $config, $url);
throw new \Exception($result->getMessage());
}
return $result->getData();
} }
@@ -135,13 +117,9 @@ class Tag extends AfficialAccount
{ {
$config = $this->config->getAccessToken(); $config = $this->config->getAccessToken();
$result = $this->request->get($this->tag_lists . $config);
$this->request->setErrorField('errcode'); $this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg'); $this->request->setErrorMsgField('errmsg');
if (!$result->isResultsOK()) { return $this->request->get($this->tag_lists . $config);
throw new \Exception($result->getMessage());
}
return $result->getData();
} }
@@ -152,13 +130,9 @@ class Tag extends AfficialAccount
public function tag_fans_list() public function tag_fans_list()
{ {
$config = $this->config->getAccessToken(); $config = $this->config->getAccessToken();
$result = $this->request->get($this->tag_fans_list . $config);
$this->request->setErrorField('errcode'); $this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg'); $this->request->setErrorMsgField('errmsg');
if (!$result->isResultsOK()) { return $this->request->get($this->tag_fans_list . $config);
throw new \Exception($result->getMessage());
}
return $result->getData();
} }
@@ -170,15 +144,11 @@ class Tag extends AfficialAccount
public function user_tag($openid) public function user_tag($openid)
{ {
$config = $this->config->getAccessToken(); $config = $this->config->getAccessToken();
$result = $this->request->post($this->user_tag . $config, [
'openid' => $openid
]);
$this->request->setErrorField('errcode'); $this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg'); $this->request->setErrorMsgField('errmsg');
if (!$result->isResultsOK()) { return $this->request->post($this->user_tag . $config, [
throw new \Exception($result->getMessage()); 'openid' => $openid
} ]);
return $result->getData();
} }
} }