1.提交缺失的东西
This commit is contained in:
5
app/api/config/project.php
Normal file
5
app/api/config/project.php
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
return [
|
||||||
|
//token过期时间
|
||||||
|
'token_expire_time' => 3600 * 24 * 60,
|
||||||
|
];
|
||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user