where('account', $account)->find(); if (!$info) { throw new LogicException('账户不存在', 1001); } if (strtoupper(md5($password)) != $info['password']) { throw new LogicException('密码错误', 1002); } return $info; } catch (BaseException $be) { throw new ResponsableException($be->getMessage(), $be->getCode()); } catch (Exception $e) { throw new ResponsableException('登录失败', 404); } } }