微信测试

This commit is contained in:
2022-09-09 11:21:23 +08:00
parent dc3f8140a0
commit c9899e260c
3 changed files with 1376 additions and 104 deletions

29
app/controller/Wechat.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
namespace app\controller;
use EasyWeChat\Factory;
use EasyWeChat\OfficialAccount\Application;
class Wechat
{
private Application $app;
private function initWechat()
{
$config = [
'app_id' => 'wx3793a03c18984e4f',
'secret' => 'f1c242f4f28f735d4687abb469072xxx',
'token' => 'TestToken',
'response_type' => 'array',
];
$this->app = Factory::officialAccount($config);
}
public function config()
{
$response = $this->app->oauth->scopes(['snsapi_userinfo'])->redirect();
return $response->send();
}
}