Files
heping-api/app/controller/Check.php
2022-09-13 15:49:38 +08:00

30 lines
690 B
PHP

<?php
namespace app\controller;
use EasyWeChat\Factory;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use think\facade\Config;
class Check
{
/**
* Notes : 微信被封检测
*
* @Date : 2022/9/13 13:39
* @Author : <Jason.C>
* @throws GuzzleException
*/
public function index()
{
$url = $GLOBALS['data']['data']['url'];
$call = 'https://mp.weixinbridge.com/mp/wapredirect?url='.urlencode($url);
$client = new Client();
$response = $client->request('GET', $call, ['allow_redirects' => false]);
dump(str_contains($response->getHeader('Location')[0], 'weixin110.qq.com'));
}
}