<?php
// ......
public function testbturl(){
$bt_type = input('post.bt_type/d');
if($bt_type == 1){
$bt_surl = input('post.bt_surl');
if(!$bt_surl)return json(['code'=>-1, 'msg'=>'参数不能为空']);
$res = get_curl($bt_surl . 'api/SetupCount');
if(strpos($res, 'ok')!==false){
return json(['code'=>0, 'msg'=>'第三方云端连接测试成功!']);
}else{
return json(['code'=>-1, 'msg'=>'第三方云端连接测试失败']);
}
}
// ......
?>
api/SetupCount可以用锚点标签等方法让curl_init忽略掉http(s)://