From f7c64f71f73c1f8cd0f2a690bac467ab69a4ced8 Mon Sep 17 00:00:00 2001 From: wang hou sheng <76928547+wanghousheng@users.noreply.github.com> Date: Thu, 11 Apr 2024 12:20:36 +0800 Subject: [PATCH] 1 --- app/api/controller/Wxserver.php | 10 +++++----- app/common/library/wxserver/Server.php | 4 +--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/api/controller/Wxserver.php b/app/api/controller/Wxserver.php index 31cfcd3a..390d8697 100644 --- a/app/api/controller/Wxserver.php +++ b/app/api/controller/Wxserver.php @@ -15,11 +15,11 @@ class Wxserver extends BaseController public function index() { - $appid = 'wx1814307a39775007'; - $obj = new \app\common\library\wxserver\Server(); - $arr = $obj->getPrivacySetting($appid); - $arr2 = $obj->setDomain($appid, $this->request->domain(true)); - return $this->renderSuccess(['arr' => $arr, 'arr2' => $arr2]); +// $appid = 'wx1814307a39775007'; +// $obj = new \app\common\library\wxserver\Server(); +// $arr = $obj->getPrivacySetting($appid); +// $arr2 = $obj->setDomain($appid, $this->request->domain(true)); +// return $this->renderSuccess(['arr' => $arr, 'arr2' => $arr2]); } diff --git a/app/common/library/wxserver/Server.php b/app/common/library/wxserver/Server.php index af549fc6..90fc88c9 100644 --- a/app/common/library/wxserver/Server.php +++ b/app/common/library/wxserver/Server.php @@ -480,7 +480,6 @@ class Server $data['downloaddomain'] = $domain; $result = $this->curlPost($url, json_encode($data)); $result = json_decode($result, true); - return $result; if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') { return true; } @@ -494,7 +493,7 @@ class Server * @return bool * @author: wanghousheng */ - public function getPrivacySetting($appid) + public function getPrivacySetting($appid): bool { $token = $this->authorizerAccessToken($appid); if ($token) { @@ -513,7 +512,6 @@ class Server $data['owner_setting']['notice_method'] = '公告'; $result = $this->curlPost($url, json_encode($data)); $result = json_decode($result, true); - return $result; if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') { return true; }