int(200) ["msg"] => string(7) "cURL ok" ["data"] => string(84) "{"gewe-token":"8bd053cb84f24770ae4df11441500427","appId":"wx_N3vKyMW8nl41epbcu891k"}" } * author:wh * @throws \Exception */ function getToken($url='') { // $base_url = SundryConfig::val('py_app_base_url'); // $url = $base_url.'/vip_groups/auth_info'; if (empty($url)){ throw new \Exception('获取url失败'); } $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失败'); } $res_data = json_decode($res['data'], true); return [ 'token' => $res_data['gewe-token'], 'appId' => $res_data['appId'], ]; } }