From 11073240e7d282e7de7847bedc7a3661dadd9463 Mon Sep 17 00:00:00 2001 From: Jason Date: Fri, 9 Sep 2022 15:59:46 +0800 Subject: [PATCH] update --- app/controller/Check.php | 13 ++++++++++--- composer.json | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/controller/Check.php b/app/controller/Check.php index 3eb7031..002fc46 100644 --- a/app/controller/Check.php +++ b/app/controller/Check.php @@ -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()); } } \ No newline at end of file diff --git a/composer.json b/composer.json index 58c13b7..7aaaab4 100644 --- a/composer.json +++ b/composer.json @@ -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",