mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update Login.php
This commit is contained in:
parent
ee18e7cb14
commit
172fa400dc
@ -81,19 +81,19 @@ class Login extends Controller
|
||||
$map = ['username' => $data['username'], 'is_deleted' => 0];
|
||||
$user = SystemUser::mk()->where($map)->findOrEmpty();
|
||||
if ($user->isEmpty()) {
|
||||
$this->app->session->set("LoginInputSessionError", true);
|
||||
$this->app->session->set('LoginInputSessionError', true);
|
||||
$this->error('登录账号或密码错误,请重新输入!');
|
||||
}
|
||||
if (empty($user['status'])) {
|
||||
$this->app->session->set("LoginInputSessionError", true);
|
||||
$this->app->session->set('LoginInputSessionError', true);
|
||||
$this->error('账号已经被禁用,请联系管理员!');
|
||||
}
|
||||
if (md5("{$user['password']}{$data['uniqid']}") !== $data['password']) {
|
||||
$this->app->session->set("LoginInputSessionError", true);
|
||||
$this->app->session->set('LoginInputSessionError', true);
|
||||
$this->error('登录账号或密码错误,请重新输入!');
|
||||
}
|
||||
$this->app->session->set('user', $user->toArray());
|
||||
$this->app->session->delete("LoginInputSessionError");
|
||||
$this->app->session->delete('LoginInputSessionError');
|
||||
$user->inc('login_num')->update([
|
||||
'login_at' => date('Y-m-d H:i:s'),
|
||||
'login_ip' => $this->app->request->ip(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user