Skip to content

Commit 7e40305

Browse files
committed
修改最后登录时间和IP
1 parent a991a09 commit 7e40305

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/apps/controllers/Page.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,5 +528,8 @@ private function setLoginStat()
528528
$tm = time();
529529
Swoole\Cookie::set('uname', $_SESSION['user']['nickname'], $tm + 86400 * 30, '/');
530530
Swoole\Cookie::set('uid', $_SESSION['user_id'], $tm + 86400 * 30, '/');
531+
$user = $this->model->UserInfo->get($_SESSION['user_id']);
532+
$user->lastlogin = Swoole\Tool::now();
533+
$user->lastip = $this->request->getClientIP();
531534
}
532535
}

0 commit comments

Comments
 (0)