改进 登录处理
This commit is contained in:
parent
fb8e832c1f
commit
bf25d56705
@ -12,26 +12,10 @@ class Authenticate extends Middleware
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return string|null
|
||||
*/
|
||||
// protected function redirectTo($request)
|
||||
// {
|
||||
// if (! $request->expectsJson()) {
|
||||
// return route('login');
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
// public function handle($request, Closure $next, $guard = null)
|
||||
// {
|
||||
// $auth = $this->auth->guard($guard);
|
||||
// if ($auth->guest()) {
|
||||
// return $this->unauthorized('Unauthorized.');
|
||||
// }
|
||||
|
||||
// $user = $this->auth->guard($guard)->user();
|
||||
// if ($user->banned_at) {
|
||||
// return $this->forbidden('您已被封禁,原因是: ' . $user->banned_reason ?? '一次或多次触犯了我们的规则。');
|
||||
// }
|
||||
|
||||
// return $next($request);
|
||||
// }
|
||||
protected function redirectTo($request)
|
||||
{
|
||||
if (! $request->expectsJson()) {
|
||||
return route('index');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,11 +23,6 @@ public function handle(Request $request, Closure $next, ...$guards)
|
||||
|
||||
foreach ($guards as $guard) {
|
||||
if (Auth::guard($guard)->check()) {
|
||||
// $user = $this->auth->guard($guard)->user();
|
||||
// if ($user->banned_at) {
|
||||
// return $this->forbidden('您已被封禁,原因是: ' . $user->banned_reason ?? '一次或多次触犯了我们的规则。');
|
||||
// }
|
||||
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
// public const HOME = '/home';
|
||||
public const HOME = '/';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, and other route configuration.
|
||||
|
Loading…
Reference in New Issue
Block a user