mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update UserTokenService.php
This commit is contained in:
parent
801788a3f2
commit
03180d64ef
@ -79,8 +79,7 @@ class UserTokenService extends Service
|
|||||||
public static function token(int $uuid, string $type): array
|
public static function token(int $uuid, string $type): array
|
||||||
{
|
{
|
||||||
// 清理无效认证数据
|
// 清理无效认证数据
|
||||||
$time = time();
|
$map1 = [['token', '<>', 'token'], ['time', '<', $time = time()]];
|
||||||
$map1 = [['token', '<>', 'token'], ['time', '<', $time]];
|
|
||||||
$map2 = [['token', '<>', 'token'], ['type', '=', $type], ['uuid', '=', $uuid]];
|
$map2 = [['token', '<>', 'token'], ['type', '=', $type], ['uuid', '=', $uuid]];
|
||||||
DataUserToken::mk()->whereOr([$map1, $map2])->delete();
|
DataUserToken::mk()->whereOr([$map1, $map2])->delete();
|
||||||
// 创建新的认证数据
|
// 创建新的认证数据
|
||||||
@ -90,7 +89,7 @@ class UserTokenService extends Service
|
|||||||
$data = array_merge($map, [
|
$data = array_merge($map, [
|
||||||
'uuid' => $uuid,
|
'uuid' => $uuid,
|
||||||
'time' => $time + static::$expire,
|
'time' => $time + static::$expire,
|
||||||
'tokenv' => static::buildVerify()
|
'tokenv' => static::buildVerify(),
|
||||||
]);
|
]);
|
||||||
if (DataUserToken::mk()->insert($data) !== false) {
|
if (DataUserToken::mk()->insert($data) !== false) {
|
||||||
return [1, '刷新认证成功', $data];
|
return [1, '刷新认证成功', $data];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user