<?php
/*
 本代码由 口号帮 创建
 创建时间 2019-05-08 16:22:09
 技术支持 口号帮 
 严禁反编译、逆向等任何形式的侵权行为，违者将追究法律责任
*/

namespace App\Http\Controllers\Auth;use App\Http\Controllers\Controller;use Illuminate\Foundation\Auth\AuthenticatesUsers;use Illuminate\Http\Request;use Illuminate\Validation\ValidationException;class LoginController extends Controller{use AuthenticatesUsers;protected $redirectTo='/admin/home';public function __construct(){$this->middleware('guest')->except('logout');}protected function validateLogin(Request $request){$this->validate($request,['username'=>'required|string','password'=>'required|string','captcha'=>'required|captcha',],['username.required'=>'账号不能为空','password.required'=>'请填密码','captcha.required'=>'请填写验证码','captcha.captcha'=>'验证码错误',]);}public function authenticated(Request $request,$user){$P2g0=$user->status==0;if($P2g0)goto P2gBodyx2;goto P2gNextx2;P2gBodyx2:$this->logout($request);throw ValidationException::withMessages([$this->username()=>['该账号已被禁用,请联系管理员']]);goto P2gx1;P2gNextx2:P2gx1:}protected function sendFailedLoginResponse(Request $request){throw ValidationException::withMessages([$this->username()=>['账号或者密码不对'],]);}public function logout(Request $request){$this->guard()->logout();$request->session()->invalidate();if($this->loggedOut($request))goto P2gBodyx4;goto P2gNextx4;P2gBodyx4:$P2g0=$this->loggedOut($request);goto P2gx3;P2gNextx4:$P2g0=redirect('/login');P2gx3:return $P2g0;}public function username(){return 'username';}}
?>