目录结构更新,增加composer支持

This commit is contained in:
2018-01-14 09:41:28 +08:00
parent ae46a73172
commit 0c7d06de51
29 changed files with 506 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<?php
return array(
'template' => array(
'view_depr' => '_'
)
);

View File

@@ -0,0 +1,37 @@
<?php
namespace app\index\controller;
use EasyWeChat\Factory;
/**
* 微信
*/
class Wechat {
public function __construct() {
$this->options = [
'app_id' => 'wx3cf0f39249eb0exxx',
'secret' => 'f1c242f4f28f735d4687abb469072xxx',
'token' => 'easywechat',
'log' => [
'level' => 'debug',
'file' => RUNTIME_PATH . '/easywechat.log',
],
];
}
public function index(){
$app = Factory::officialAccount($this->options);
$server = $app->server;
$user = $app->user;
// $server->push(function($message) use ($user) {
// $fromUser = $user->get($message['FromUserName']);
// return "{$fromUser->nickname} 您好!欢迎关注 overtrue!";
// });
$server->serve()->send();
}
}