<?php
 namespace App\Http\Middleware; use TechOnline\Laravel\Http\Request; use TechOnline\Laravel\Http\Response; use TechSoft\Laravel\Member\Interfaces\MemberLoginCheck; use TechSoft\Laravel\Oauth\OauthType; class MemberAuth extends \TechSoft\Laravel\Member\Middleware\MemberAuth { protected function check($controller, $action, $memberUser) { if (is_subclass_of($controller, MemberLoginCheck::class)) { if (empty($memberUser['id'])) { if (property_exists($controller, 'ignoreAction') && is_array($controller::$ignoreAction) && in_array($action, $controller::$ignoreAction) ) { } else { $ret = Response::send(-1, null, null, action('\App\Modules\User\Mobile\OauthController@login', [ 'oauthType' => OauthType::WECHAT_MOBILE, 'redirect' => Request::currentPageUrl(), ]) ); return Response::generate(-1, null, $ret); } } } return Response::generate(0, 'ok'); } }