public function user(){
$url="接口路径";
$ch =curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$result =curl_exec($ch);
curl_close($ch);
$data=json_decode($result,true);
$this->assign('data',$data);
$this->display();
curl具体所有函数用法参考以下链接地址:http://www.thinkphp.cn/topic/41390.html
阿里云学生机1年114元限时活动(24岁以下都可以购买)https://promotion.aliyun.com/ntms/act/campus2018.html?userCode=a6violqw阿里云1888元红包:https://promotion.aliyun.com/ntms/yunparter/invite.html?userCode=a6violqw