From 0f7725775706456fbcc97d81a4c0b9e0ece25c08 Mon Sep 17 00:00:00 2001 From: augushong Date: Wed, 4 Oct 2023 09:37:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E6=8A=80=E6=9C=AF=E5=80=BA?= =?UTF-8?q?=E5=8A=A1=EF=BC=9B=E5=8F=91=E5=B8=83=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/base/admin/controller/LoginClass.php | 96 ------------------- .../base/common/command/admin/VersionBase.php | 4 +- 2 files changed, 2 insertions(+), 98 deletions(-) delete mode 100644 extend/base/admin/controller/LoginClass.php diff --git a/extend/base/admin/controller/LoginClass.php b/extend/base/admin/controller/LoginClass.php deleted file mode 100644 index 077031f..0000000 --- a/extend/base/admin/controller/LoginClass.php +++ /dev/null @@ -1,96 +0,0 @@ -request->action(); - if (!empty(session('admin')) && !in_array($action, ['out'])) { - $adminModuleName = config('app.admin_alias_name'); - $this->success('已登录,无需再次登录', [], __url("@{$adminModuleName}")); - } - } - - /** - * 用户登录. - * @return string - * @throws \Exception - */ - public function index() - { - event_response('AdminLoginIndex', [ - 'controller' => $this, - ]); - - $captcha = Env::get('adminsystem.captcha', 1); - if ($this->request->isPost()) { - $post = $this->request->post(); - $rule = [ - 'username|用户名' => 'require', - 'password|密码' => 'require', - 'keep_login|是否保持登录' => 'require', - ]; - $captcha == 1 && $rule['captcha|验证码'] = 'require|captcha'; - $this->validate($post, $rule); - $admin = SystemAdmin::where(['username' => $post['username']])->find(); - if (empty($admin)) { - $this->error('用户不存在'); - } - if (password($post['password']) != $admin->password) { - $this->error('密码输入有误'); - } - if ($admin->status == 0) { - $this->error('账号已被禁用'); - } - $admin->login_num += 1; - $admin->save(); - - Event::trigger('AdminLoginSuccess', $admin); - - $admin = $admin->toArray(); - unset($admin['password']); - $admin['expire_time'] = $post['keep_login'] == 1 ? true : time() + 7200; - session('admin', $admin); - - $this->success('登录成功'); - } - $this->assign('captcha', $captcha); - $this->assign('demo', $this->isDemo); - - return $this->fetch(); - } - - /** - * 用户退出. - * @return mixed - */ - public function out() - { - session('admin', null); - $this->success('退出登录成功'); - } - - /** - * 验证码 - * @return \think\Response - */ - public function captcha() - { - return Captcha::create(); - } -} diff --git a/extend/base/common/command/admin/VersionBase.php b/extend/base/common/command/admin/VersionBase.php index 866ff81..47ab7ee 100644 --- a/extend/base/common/command/admin/VersionBase.php +++ b/extend/base/common/command/admin/VersionBase.php @@ -12,12 +12,12 @@ use think\console\Output; class VersionBase extends Command { - public const VERSION = 'v2.0.54'; + public const VERSION = 'v2.0.55'; public const LAYUI_VERSION = '2.8.17'; public const COMMENT = [ - '增加登录跳转到指定页面', + '清理技术债务', '发布新版本', ];