From 0052d8ad2832fe1b3fc5fe17eb2ee010c48cd9f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sat, 6 Jul 2024 10:01:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=99=BB=E5=BD=95=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/Login.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/admin/controller/Login.php b/app/admin/controller/Login.php index f2606dccb..0d4a81332 100644 --- a/app/admin/controller/Login.php +++ b/app/admin/controller/Login.php @@ -95,9 +95,9 @@ class Login extends Controller $user->hidden(['sort', 'status', 'password', 'is_deleted']); $this->app->session->set('user', $user->toArray()); $this->app->session->delete('LoginInputSessionError'); - $user->inc('login_num')->save([ - 'login_at' => date('Y-m-d H:i:s'), - 'login_ip' => $this->app->request->ip(), + // 更新登录次数 + SystemUser::mk()->where(['id' => $user->getAttr('id')])->inc('login_num')->update([ + 'login_at' => date('Y-m-d H:i:s'), 'login_ip' => $this->app->request->ip(), ]); // 刷新用户权限 AdminService::apply(true);