wang hou sheng 8 months ago
parent 26481c9b80
commit f7c64f71f7
  1. 10
      app/api/controller/Wxserver.php
  2. 4
      app/common/library/wxserver/Server.php

@ -15,11 +15,11 @@ class Wxserver extends BaseController
public function index() public function index()
{ {
$appid = 'wx1814307a39775007'; // $appid = 'wx1814307a39775007';
$obj = new \app\common\library\wxserver\Server(); // $obj = new \app\common\library\wxserver\Server();
$arr = $obj->getPrivacySetting($appid); // $arr = $obj->getPrivacySetting($appid);
$arr2 = $obj->setDomain($appid, $this->request->domain(true)); // $arr2 = $obj->setDomain($appid, $this->request->domain(true));
return $this->renderSuccess(['arr' => $arr, 'arr2' => $arr2]); // return $this->renderSuccess(['arr' => $arr, 'arr2' => $arr2]);
} }

@ -480,7 +480,6 @@ class Server
$data['downloaddomain'] = $domain; $data['downloaddomain'] = $domain;
$result = $this->curlPost($url, json_encode($data)); $result = $this->curlPost($url, json_encode($data));
$result = json_decode($result, true); $result = json_decode($result, true);
return $result;
if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') { if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') {
return true; return true;
} }
@ -494,7 +493,7 @@ class Server
* @return bool * @return bool
* @author: wanghousheng * @author: wanghousheng
*/ */
public function getPrivacySetting($appid) public function getPrivacySetting($appid): bool
{ {
$token = $this->authorizerAccessToken($appid); $token = $this->authorizerAccessToken($appid);
if ($token) { if ($token) {
@ -513,7 +512,6 @@ class Server
$data['owner_setting']['notice_method'] = '公告'; $data['owner_setting']['notice_method'] = '公告';
$result = $this->curlPost($url, json_encode($data)); $result = $this->curlPost($url, json_encode($data));
$result = json_decode($result, true); $result = json_decode($result, true);
return $result;
if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') { if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') {
return true; return true;
} }

Loading…
Cancel
Save