wang hou sheng 8 months ago
parent 8ed04dbf20
commit ee3ca08c14
  1. 5
      app/api/controller/Wxserver.php
  2. 12
      app/common/library/wxserver/Server.php

@ -17,9 +17,8 @@ class Wxserver extends BaseController
{ {
$appid = 'wxe3ed157849bd07b5'; $appid = 'wxe3ed157849bd07b5';
$obj = new \app\common\library\wxserver\Server(); $obj = new \app\common\library\wxserver\Server();
$domain = $this->request->domain(true); $arr = $obj->getPrivacySetting($appid);
$arr = $obj->setDomain($appid, $domain); return $this->renderSuccess(['arr' => $arr]);
return $this->renderSuccess(['domain' => $domain, 'arr' => $arr]);
} }

@ -487,6 +487,18 @@ class Server
} }
} }
public function getPrivacySetting($appid)
{
$token = $this->authorizerAccessToken($appid);
if ($token) {
$url = "https://api.weixin.qq.com/cgi-bin/component/getprivacysetting?access_token=$token";
$data['privacy_ver'] = 1;
$result = $this->curlPost($url, json_encode($data));
return json_decode($result, true);
}
return [];
}
public function apiText($authorization_code, $touser) public function apiText($authorization_code, $touser)
{ {
$url = 'https://api.weixin.qq.com/cgi-bin/component/api_query_auth?component_access_token=' . $this->getComponentAccessToken(); $url = 'https://api.weixin.qq.com/cgi-bin/component/api_query_auth?component_access_token=' . $this->getComponentAccessToken();

Loading…
Cancel
Save