ai地址动态
This commit is contained in:
@@ -37,7 +37,7 @@ class BaseWechatLogic
|
||||
if(empty($this->base_url)){
|
||||
throw new \Exception('请先设置ai客服配置');
|
||||
}
|
||||
$tokenArr = (new TokenWechatLogic())->getToken();
|
||||
$tokenArr = (new TokenWechatLogic())->getToken($this->base_url);
|
||||
$postdata['appId'] = $tokenArr['appId'];
|
||||
$domain = $this->base_url;
|
||||
$timeout = 4;
|
||||
|
||||
@@ -25,9 +25,15 @@ class TokenWechatLogic extends BaseWechatLogic
|
||||
* @return string
|
||||
* @throws \Exception
|
||||
*/
|
||||
function getToken()
|
||||
function getToken($url ='')
|
||||
{
|
||||
$url = 'https://wechat-api-test.excn.vip/vip_groups/auth_info';
|
||||
if (empty($url)){
|
||||
throw new \Exception('获取url失败');
|
||||
}
|
||||
|
||||
// $url = 'https://wechat-api-test.excn.vip/vip_groups/auth_info';
|
||||
$base_url = parse_url($url);
|
||||
$url = $base_url['scheme'].'://'.$base_url['host'].'/vip_groups/auth_info';
|
||||
$res = \wanghua\general_utility_tools_php\http\Curl::curl_post($url, []);
|
||||
if(empty($res['data'])){
|
||||
throw new \Exception('获取token失败');
|
||||
|
||||
Reference in New Issue
Block a user