Files
ProxyPanel/app/Components/Curl.php
Bretton 6b19a5054b 小版本1.1更新: 众多BUG修复与优化
1. 彻底放弃向闭源版转型,清理掉一批闭源/烂尾的代码;
2. 重新优化优惠券功能的显示与生成;
    2.1 现在用户使用优惠券后,购买页面会有优惠券优惠价格等提示;
    2.2 支持管理自己定义优惠券代码,可是用HappyNewYear 这样的码了;
3. 管理员页面各搜索功能的BUG修改;
    3.1 部分页面的搜索条件添加,以及对之前代码的烂尾进行补全;
    3.2 统一代码检查用isset而非 !isEmpty, 来减少误判;
    3.3 对搜索在不同设备下的显示进行了优化;
4. 针对html 和 js 项目的代码规范以及简写;
5. 针对 debug方便;添加了debug工具;
     提示:请各位在生产环境下关闭debug模式;
2020-08-05 03:20:19 +08:00

32 lines
765 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, 3);
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);
}
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
}