mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
更新登录统计
This commit is contained in:
parent
217445d3f0
commit
0052d8ad28
@ -95,9 +95,9 @@ class Login extends Controller
|
|||||||
$user->hidden(['sort', 'status', 'password', 'is_deleted']);
|
$user->hidden(['sort', 'status', 'password', 'is_deleted']);
|
||||||
$this->app->session->set('user', $user->toArray());
|
$this->app->session->set('user', $user->toArray());
|
||||||
$this->app->session->delete('LoginInputSessionError');
|
$this->app->session->delete('LoginInputSessionError');
|
||||||
$user->inc('login_num')->save([
|
// 更新登录次数
|
||||||
'login_at' => date('Y-m-d H:i:s'),
|
SystemUser::mk()->where(['id' => $user->getAttr('id')])->inc('login_num')->update([
|
||||||
'login_ip' => $this->app->request->ip(),
|
'login_at' => date('Y-m-d H:i:s'), 'login_ip' => $this->app->request->ip(),
|
||||||
]);
|
]);
|
||||||
// 刷新用户权限
|
// 刷新用户权限
|
||||||
AdminService::apply(true);
|
AdminService::apply(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user