diff --git a/app/admin/controller/Wxserve.php b/app/admin/controller/Wxserve.php index ec802f44..25bf2f2e 100644 --- a/app/admin/controller/Wxserve.php +++ b/app/admin/controller/Wxserve.php @@ -198,7 +198,7 @@ class Wxserve extends Controller $appid = $this->request->get('appid'); if ($appid) { $obj = new Server(); - if ($obj->getVersioninfo($appid)) { + if ($obj->getVersioninfo($appid) && $obj->setDomain($appid, $this->request->domain(true))) { return $this->renderSuccess('success'); } } diff --git a/app/common/library/wxserver/Server.php b/app/common/library/wxserver/Server.php index 569778c1..56d9f68d 100644 --- a/app/common/library/wxserver/Server.php +++ b/app/common/library/wxserver/Server.php @@ -489,13 +489,13 @@ class Server * @return bool * @author: wanghousheng */ - public function setDomain($appid, $domain) + public function setDomain($appid, $domain): bool { $token = $this->authorizerAccessToken($appid); if ($token) { $url = "https://api.weixin.qq.com/wxa/modify_domain_directly?access_token=$token"; $data['action'] = 'set'; - $data['requestdomain'] = $domain; + $data['requestdomain'] = [$domain, 'https://apis.map.gg.com']; $data['uploaddomain'] = $domain; $data['downloaddomain'] = $domain; $result = $this->curlPost($url, json_encode($data)); diff --git a/app/common/library/wxserver/Wholesaler.php b/app/common/library/wxserver/Wholesaler.php index 1376fdff..beab49fd 100644 --- a/app/common/library/wxserver/Wholesaler.php +++ b/app/common/library/wxserver/Wholesaler.php @@ -490,13 +490,13 @@ class Wholesaler * @return bool * @author: wanghousheng */ - public function setDomain($appid, $domain) + public function setDomain($appid, $domain): bool { $token = $this->authorizerAccessToken($appid); if ($token) { $url = "https://api.weixin.qq.com/wxa/modify_domain_directly?access_token=$token"; $data['action'] = 'set'; - $data['requestdomain'] = $domain; + $data['requestdomain'] = [$domain, 'https://apis.map.gg.com']; $data['uploaddomain'] = $domain; $data['downloaddomain'] = $domain; $result = $this->curlPost($url, json_encode($data));