File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -100,13 +100,13 @@ Route::any('/wechat', 'WechatController@serve');
100100然后创建控制器 ` WechatController ` :
101101
102102``` php
103- <?php
103+ <?php
104104
105105namespace App\Http\Controllers;
106106
107107use Log;
108108
109- class WechatController extends Controller
109+ class WechatController extends Controller
110110{
111111
112112 /**
@@ -135,13 +135,13 @@ class WechatController extends Controller
135135##### 使用容器的自动注入
136136
137137``` php
138- <?php
138+ <?php
139139
140140namespace App\Http\Controllers;
141141
142142use EasyWeChat\Foundation\Application;
143143
144- class WechatController extends Controller
144+ class WechatController extends Controller
145145{
146146
147147 public function demo(Application $wechat)
@@ -172,7 +172,7 @@ class WechatController extends Controller
172172
173173使用中间件的情况下 ` app/config/wechat.php ` 中的 ` oauth.callback ` 就随便填写吧(因为用不着了 :smile : )。
174174
175- 1 . 在 ` app/Http/routes .php ` 中添加路由中间件:
175+ 1 . 在 ` app/Http/Kernel .php ` 中添加路由中间件:
176176
177177``` php
178178protected $routeMiddleware = [
@@ -190,7 +190,7 @@ protected $routeMiddleware = [
190190Route::group(['middleware' => ['web', 'wechat.oauth']], function () {
191191 Route::get('/user', function () {
192192 $user = session('wechat.oauth_user'); // 拿到授权用户资料
193-
193+
194194 dd($user);
195195 });
196196});
You can’t perform that action at this time.
0 commit comments