mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update UserService.php
This commit is contained in:
parent
61cd4e9d2d
commit
01dd3048e6
@ -194,8 +194,8 @@ class UserService extends Service
|
|||||||
public function token(int $uuid, string $type): array
|
public function token(int $uuid, string $type): array
|
||||||
{
|
{
|
||||||
// 清理无效认证数据
|
// 清理无效认证数据
|
||||||
$map1 = [['time', '<', $time = time()]];
|
$map1 = [['uid', '=', $uuid], ['type', '=', $type]];
|
||||||
$map2 = [['uid', '=', $uuid], ['type', '=', $type]];
|
$map2 = [['time', '<', $time = time()], ['token', '<>', 'token']];
|
||||||
$this->app->db->name('DataUserToken')->whereOr([$map1, $map2])->delete();
|
$this->app->db->name('DataUserToken')->whereOr([$map1, $map2])->delete();
|
||||||
// 创建新的认证数据
|
// 创建新的认证数据
|
||||||
do $map = ['type' => $type, 'token' => md5(uniqid() . rand(100, 999))];
|
do $map = ['type' => $type, 'token' => md5(uniqid() . rand(100, 999))];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user