This commit is contained in:
2022-09-09 15:59:46 +08:00
parent db887aef13
commit 11073240e7
2 changed files with 12 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
namespace app\controller;
use EasyWeChat\Factory;
use GuzzleHttp\Client;
use think\facade\Config;
class Check
@@ -10,11 +11,17 @@ class Check
public function index()
{
$url = $GLOBALS['data']['data']['url'];
$url = $GLOBALS['data']['data']['url'];
$call = 'https://mp.weixinbridge.com/mp/wapredirect?url='.$url;
$app = Factory::officialAccount(Config::get('wechat'));
$client = new Client();
$response = $client->request('GET', urlencode($call));
dump($app->url->shorten($url));
dump($response);
//weixin110.qq.com
dump($response->getReasonPhrase());
dump($response->getBody());
dump($response->getStatusCode());
}
}

View File

@@ -26,7 +26,8 @@
"alibabacloud/client": "^1.5",
"aliyuncs/oss-sdk-php": "^2.6",
"topthink/think-view": "^1.0",
"overtrue/wechat": "~5.0"
"overtrue/wechat": "~5.0",
"guzzlehttp/guzzle": "^7.5"
},
"require-dev": {
"symfony/var-dumper": "^4.2",