From e86a04ce743923638f5313276cd74dd04644be90 Mon Sep 17 00:00:00 2001 From: xucong <850806214@qq.com> Date: Wed, 14 May 2025 23:53:52 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=8F=90=E4=BA=A4=E7=BC=BA=E5=A4=B1=E7=9A=84?= =?UTF-8?q?=E4=B8=9C=E8=A5=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/config/project.php | 5 +++++ app/api/logic/LoginLogic.php | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 app/api/config/project.php diff --git a/app/api/config/project.php b/app/api/config/project.php new file mode 100644 index 0000000..a7558f7 --- /dev/null +++ b/app/api/config/project.php @@ -0,0 +1,5 @@ + 3600 * 24 * 60, +]; \ No newline at end of file diff --git a/app/api/logic/LoginLogic.php b/app/api/logic/LoginLogic.php index fb2cd36..a1dff54 100755 --- a/app/api/logic/LoginLogic.php +++ b/app/api/logic/LoginLogic.php @@ -401,7 +401,7 @@ class LoginLogic extends LogicBase { //清除之前缓存 - $token = Db::name('session') + $token = Db::name('user_session') ->where(['user_id' => $user_id, 'client' => $client]) ->value('token'); if($token) { @@ -409,7 +409,7 @@ class LoginLogic extends LogicBase $token_cache->del(); } - $result = Db::name('session') + $result = Db::name('user_session') ->where(['user_id' => $user_id, 'client' => $client]) ->find(); @@ -425,9 +425,9 @@ class LoginLogic extends LogicBase ]; if (empty($result)) { - Db::name('session')->insert($data); + Db::name('user_session')->insert($data); } else { - Db::name('session') + Db::name('user_session') ->where(['user_id' => $user_id, 'client' => $client]) ->update($data); }