request->isAjax()) { $post = request()->post(); (new LoginValidate())->goCheck(); if (LoginLogic::login($post)){ return JsonServer::success('登录成功'); } $error = LoginLogic::getError() ?: '登录失败'; return JsonServer::error($error); } return view('', [ 'account' => cookie('account'), 'config' => LoginLogic::config(), ]); } /** * Notes: 退出登录 * @author FZR(2021/1/28 18:44) */ public function logout() { LoginLogic::logout(); $this->redirect(url('login/login')); } }