dyjh 6 years ago
parent
commit
409191f63f

+ 4 - 4
app/Http/Controllers/Web/AuthController.php

@@ -16,9 +16,9 @@ class AuthController extends Controller
 {
 {
     public function bind(Request $request)
     public function bind(Request $request)
     {
     {
-        $user = session('wechat.oauth_user.default');
-        dd($user);
-        /*$store_id = $request->input('store_id');
+      //  $user = session('wechat.oauth_user.default');
+       // dd($user);
+        $store_id = $request->input('store_id');
         $weChatApp = AlbumManufacturerModel::where('store_id', $store_id)->first();
         $weChatApp = AlbumManufacturerModel::where('store_id', $store_id)->first();
         $config = [
         $config = [
             'app_id' => $weChatApp->G_app_id,
             'app_id' => $weChatApp->G_app_id,
@@ -30,7 +30,7 @@ class AuthController extends Controller
         $app = Factory::officialAccount($config);
         $app = Factory::officialAccount($config);
         $response = $app->oauth
         $response = $app->oauth
             ->redirect();
             ->redirect();
-        return $response;*/
+        return $response;
         //$res = $response->send();
         //$res = $response->send();
       //  dd($res);
       //  dd($res);
     }
     }

+ 1 - 0
app/Http/Middleware/VerifyCsrfToken.php

@@ -13,6 +13,7 @@ class VerifyCsrfToken extends BaseVerifier
      */
      */
     protected $except = [
     protected $except = [
         //
         //
+        "wechat",
         "notify",
         "notify",
         "admin/Base/Attachment/*"
         "admin/Base/Attachment/*"
     ];
     ];

+ 0 - 4
routes/web.php

@@ -42,7 +42,3 @@ Route::get('image/{md5}', [
 Route::get('/test', 'TestController@index');
 Route::get('/test', 'TestController@index');
 Route::get('/web/bind', 'Web\AuthController@bind');
 Route::get('/web/bind', 'Web\AuthController@bind');
 Route::get('/web/notify', 'Web\AuthController@notify');
 Route::get('/web/notify', 'Web\AuthController@notify');
-Route::group(['prefix' => 'web',
-    'namespace' => 'Web',
-    'middleware' => ['web', 'wechat.oauth:snsapi_userinfo']
-],function(){Route::any('bind', 'AuthController@bind');});