|
|
|
@ -462,7 +462,14 @@ class Server |
|
|
|
|
return $list; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function setDomainDirectly($appid, $domain) |
|
|
|
|
/** |
|
|
|
|
* @notes:设置域名 |
|
|
|
|
* @param $appid |
|
|
|
|
* @param $domain |
|
|
|
|
* @return bool |
|
|
|
|
* @author: wanghousheng |
|
|
|
|
*/ |
|
|
|
|
public function setDomain($appid, $domain): bool |
|
|
|
|
{ |
|
|
|
|
$url = 'https://api.weixin.qq.com/wxa/modify_domain_directly?access_token=' . $this->authorizerAccessToken($appid); |
|
|
|
|
$data['action'] = 'set'; |
|
|
|
@ -474,7 +481,10 @@ 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; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function apiText($authorization_code, $touser) |
|
|
|
@ -500,12 +510,13 @@ class Server |
|
|
|
|
/** |
|
|
|
|
* @notes:获取授权信息 |
|
|
|
|
* @param $authorization_code |
|
|
|
|
* @param string $domain |
|
|
|
|
* @throws DataNotFoundException |
|
|
|
|
* @throws DbException |
|
|
|
|
* @throws ModelNotFoundException |
|
|
|
|
* @author: wanghousheng |
|
|
|
|
*/ |
|
|
|
|
public function authorizationInfo($authorization_code) |
|
|
|
|
public function authorizationInfo($authorization_code, string $domain = '') |
|
|
|
|
{ |
|
|
|
|
$url = 'https://api.weixin.qq.com/cgi-bin/component/api_query_auth?component_access_token=' . $this->getComponentAccessToken(); |
|
|
|
|
$data = []; |
|
|
|
@ -541,6 +552,8 @@ class Server |
|
|
|
|
$insert_data['create_time'] = time(); |
|
|
|
|
$insert_data['update_time'] = time(); |
|
|
|
|
$model->insertGetId($insert_data); |
|
|
|
|
//设置域名信息 |
|
|
|
|
$this->setDomain($insert_data['appid'], $domain); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|