fix: 反向代理获取真实IPbug

This commit is contained in:
Ying
2022-08-23 11:11:42 +08:00
parent 4bcb947656
commit f9831aad9e
6 changed files with 9 additions and 9 deletions

View File

@@ -92,7 +92,7 @@ class Auth
/**
* 禁止批量注册
*/
$where[] = ['create_ip', '=', ip2long(request()->getRemoteIp())];
$where[] = ['create_ip', '=', ip2long(request()->getRealIp())];
$where[] = ['create_time', '>', linux_extime(1)];
$totalMax = UserModel::where($where)->count();
@@ -173,7 +173,7 @@ class Auth
$userUpdate = [
'id' => $this->userInfo['id'],
'login_time' => time(),
'login_ip' => request()->getRemoteIp(),
'login_ip' => request()->getRealIp(),
'login_count' => $this->userInfo['login_count'] + 1,
];