diff --git a/app/api/controller/Wxserver.php b/app/api/controller/Wxserver.php index 946b8e1a..26cbf57c 100644 --- a/app/api/controller/Wxserver.php +++ b/app/api/controller/Wxserver.php @@ -17,7 +17,7 @@ class Wxserver extends BaseController { $obj = new \app\common\library\wxserver\Server(); $domain = $this->request->domain(true); - $arr = $obj->setDomain($this->request->domain(true), 'wx1814307a39775007'); + $arr = $obj->setDomain($this->request->domain(true), 'wxe3ed157849bd07b5'); return $this->renderSuccess(['domain' => $domain, 'arr' => $arr]); } diff --git a/app/common/library/wxserver/Server.php b/app/common/library/wxserver/Server.php index b9058fac..5b7d5faf 100644 --- a/app/common/library/wxserver/Server.php +++ b/app/common/library/wxserver/Server.php @@ -466,12 +466,11 @@ class Server * @notes:设置域名 * @param $appid * @param $domain - * @return bool * @author: wanghousheng */ - public function setDomain($appid, $domain): bool + public function setDomain($appid, $domain) { - $url = 'https://api.weixin.qq.com/wxa/modify_domain_directly?access_token=' . $this->authorizerAccessToken($appid); + $url = 'https://api.weixin.qq.com/wxa/modify_domain?access_token=' . $this->authorizerAccessToken($appid); $data['action'] = 'set'; $data['requestdomain'] = [$domain]; $data['wsrequestdomain'] = []; @@ -481,6 +480,7 @@ class Server $data['tcpdomain'] = []; $result = $this->curlPost($url, json_encode($data)); $result = json_decode($result, true); + return $result; if ($result && !empty($result['errmsg']) && $result['errmsg'] == 'ok') { return true; }