微信测试
This commit is contained in:
29
app/controller/Wechat.php
Normal file
29
app/controller/Wechat.php
Normal 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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,11 +20,12 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"php": ">=7.4",
|
||||
"topthink/framework": "^6.0.0",
|
||||
"topthink/think-orm": "^2.0",
|
||||
"alibabacloud/client": "^1.5",
|
||||
"aliyuncs/oss-sdk-php": "^2.6"
|
||||
"aliyuncs/oss-sdk-php": "^2.6",
|
||||
"overtrue/wechat": "~5.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/var-dumper": "^4.2",
|
||||
@@ -39,7 +40,10 @@
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist"
|
||||
"preferred-install": "dist",
|
||||
"allow-plugins": {
|
||||
"easywechat-composer/easywechat-composer": true
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-autoload-dump": [
|
||||
|
||||
1439
composer.lock
generated
1439
composer.lock
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user