增加操作日志记录&&web站点检查
This commit is contained in:
@@ -10,6 +10,7 @@ use support\Request;
|
||||
use support\Db;
|
||||
use support\Cache;
|
||||
use support\Redis;
|
||||
use GuzzleHttp\Client;
|
||||
|
||||
class IndexController
|
||||
{
|
||||
@@ -101,11 +102,46 @@ class IndexController
|
||||
|
||||
public function test(Request $request)
|
||||
{
|
||||
$result = $this->tocurl('https://magicbridgeauto.com');
|
||||
if (preg_match('/magicbridgeauto/', $result['body'])) {
|
||||
echo "未被篡改";
|
||||
flg("【magicbridgeauto】未被篡改");
|
||||
} else {
|
||||
echo "已被篡改";
|
||||
flg("【magicbridgeauto】已被篡改");
|
||||
}
|
||||
}
|
||||
|
||||
$info = \app\common\model\PurchaseOrders::find(14);
|
||||
$service = new \app\common\service\PurchaseOrdersService();
|
||||
$result = $service->startApproval($info);
|
||||
|
||||
return json($result);
|
||||
public function tocurl($url, $header = null, $content = null)
|
||||
{
|
||||
$ch = curl_init();
|
||||
if(substr($url,0,5)=='https'){
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // 从证书中检查SSL加密算法是否存在
|
||||
curl_setopt($ch, CURLOPT_SSLVERSION, 1);
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
if (is_array($header)) {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
if (!empty($content)) {
|
||||
if (is_array($content)) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($content));
|
||||
} else if (is_string($content)) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
|
||||
}
|
||||
}
|
||||
$response = curl_exec($ch);
|
||||
$error=curl_error($ch);
|
||||
if($error){
|
||||
die($error);
|
||||
}
|
||||
$header = curl_getinfo($ch);
|
||||
curl_close($ch);
|
||||
$data = array('header' => $header,'body' => $response);
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user