Files
ProxyPanel/app/Components/Curl.php
兔姬桑 71ffad2718 2.2 版本 BUG修复与使用优化
0. 更新项目依赖包;
1. 适配Payment依赖包5.0的代码修改;
2. 独立化节点阻断检测功能; 现在运行管理在节点页面,单独测试节点;
3. 节点阻断检测通知功能不再是一个报告一个报告发,改为一次检测只在有阻断出现情况下,统一发送结果;
4. 修改激活逻辑;
5. 修复重复优惠券SN码无报错的问题;现在优惠码为唯一码,不允许重复码出现;
6. 添加用户获取节点信息时按钮的动画加载效果;
7. 修复管理系统页面部分选项输入任何值都会报错的问题;
8. 代码命名与书写规范化;
2020-08-05 03:20:25 +08:00

32 lines
659 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace App\Components;
class Curl
{
/**
* @param string $url 请求地址
* @param array $data 数据如果有数据则用POST请求
*
* @return mixed
*/
public static function send($url, $data = [])
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_URL, $url);
if($data){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
}
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
}