1.提交缺失的东西

This commit is contained in:
2025-05-14 23:53:52 +08:00
parent f060833a6f
commit e86a04ce74
2 changed files with 9 additions and 4 deletions

View File

@ -0,0 +1,5 @@
<?php
return [
//token过期时间
'token_expire_time' => 3600 * 24 * 60,
];

View File

@ -401,7 +401,7 @@ class LoginLogic extends LogicBase
{ {
//清除之前缓存 //清除之前缓存
$token = Db::name('session') $token = Db::name('user_session')
->where(['user_id' => $user_id, 'client' => $client]) ->where(['user_id' => $user_id, 'client' => $client])
->value('token'); ->value('token');
if($token) { if($token) {
@ -409,7 +409,7 @@ class LoginLogic extends LogicBase
$token_cache->del(); $token_cache->del();
} }
$result = Db::name('session') $result = Db::name('user_session')
->where(['user_id' => $user_id, 'client' => $client]) ->where(['user_id' => $user_id, 'client' => $client])
->find(); ->find();
@ -425,9 +425,9 @@ class LoginLogic extends LogicBase
]; ];
if (empty($result)) { if (empty($result)) {
Db::name('session')->insert($data); Db::name('user_session')->insert($data);
} else { } else {
Db::name('session') Db::name('user_session')
->where(['user_id' => $user_id, 'client' => $client]) ->where(['user_id' => $user_id, 'client' => $client])
->update($data); ->update($data);
} }