wang hou sheng 7 months ago
parent 6cfe2e3452
commit f11ec01a22
  1. 2
      app/admin/controller/Wxserve.php
  2. 4
      app/common/library/wxserver/Server.php
  3. 4
      app/common/library/wxserver/Wholesaler.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');
}
}

@ -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));

@ -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));

Loading…
Cancel
Save