长时间不操作,自动退出登录

This commit is contained in:
2024-12-05 14:52:07 +08:00
parent 8d029785cf
commit be761fff26
2 changed files with 24 additions and 0 deletions

View File

@@ -64,6 +64,10 @@ class LoginController extends BaseAdminController
}
$admin['title'] = $title;
// 设置登录过期时间
$opKey = 'op_user_'. $admin['uid'];
$redis->set($opKey, time());
$redis->expire($opKey, 3600);
return [
'userInfo' => $admin,
'token' => $adminAccessToken->access_token