/** * 动作:后台执行登录 * * @param Request $request * @return \Illuminate\Http\RedirectResponse */ public function postLogin(Request $request) { if (Auth::attempt(['username' => $request->get('username'), 'password' => $request->get('password')])) { return responseSuccess('登录成功', 'admin'); } return responseFail('用户名或密码错误'); }
/** * 删除 * * @param ineger $id 公众号iD */ public function getDestroy($id) { $role = $this->roleRepository->getById($id); if ($role->user) { return responseFail('该角色下存在用户不能删除'); } $this->roleRepository->destroy($id); return responseSuccess('删除成功'); }