From d605600657aecc80164e95c090363edbabf62812 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Thu, 19 Sep 2019 18:58:46 +0800 Subject: [PATCH] add clear --- wx/Config.php | 21 +++++++++++++++++++++ wx/Miniprogarampage.php | 1 + 2 files changed, 22 insertions(+) diff --git a/wx/Config.php b/wx/Config.php index 05dd8cc..483eb8f 100644 --- a/wx/Config.php +++ b/wx/Config.php @@ -107,6 +107,27 @@ class Config */ private $key = ''; private $access_token = ''; + private $agent = ''; + + /** + * @return string + */ + public function getAgent(): string + { + return $this->agent; + } + + /** + * @param string $agent + * @return Config + */ + public function setAgent(string $agent): Config + { + $this->agent = $agent; + return $this; + } + + /** * @return string diff --git a/wx/Miniprogarampage.php b/wx/Miniprogarampage.php index 5ca6dd9..e6e3d0d 100644 --- a/wx/Miniprogarampage.php +++ b/wx/Miniprogarampage.php @@ -29,6 +29,7 @@ abstract class Miniprogarampage $this->request = new WxClient(); } $this->request->setIsSSL(true); + $this->request->setAgent($this->config->getAgent()); } /**