1
0
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:
邹景立 2021-03-11 17:09:38 +08:00
parent 61cd4e9d2d
commit 01dd3048e6

@ -194,8 +194,8 @@ class UserService extends Service
public function token(int $uuid, string $type): array
{
// 清理无效认证数据
$map1 = [['time', '<', $time = time()]];
$map2 = [['uid', '=', $uuid], ['type', '=', $type]];
$map1 = [['uid', '=', $uuid], ['type', '=', $type]];
$map2 = [['time', '<', $time = time()], ['token', '<>', 'token']];
$this->app->db->name('DataUserToken')->whereOr([$map1, $map2])->delete();
// 创建新的认证数据
do $map = ['type' => $type, 'token' => md5(uniqid() . rand(100, 999))];