no message

This commit is contained in:
kuaifan 2025-04-21 01:54:50 +08:00
parent c51870ff79
commit 92c4565590
2 changed files with 12 additions and 5 deletions

View File

@ -8,6 +8,7 @@ use Cache;
use Carbon\Carbon;
use DeviceDetector\DeviceDetector;
use Illuminate\Database\Eloquent\SoftDeletes;
use Request;
/**
* App\Models\UserDevice
@ -219,15 +220,21 @@ class UserDevice extends AbstractModel
$userid = $info['userid'] ?? 0;
$expiredAt = $info['expired_at'] ?? null;
}
$deviceData = [
'detail' => Base::array2json(self::getDeviceInfo($_SERVER['HTTP_USER_AGENT'] ?? '')),
'expired_at' => $expiredAt,
];
$hash = md5($token);
$row = self::updateInsert([
'userid' => $userid,
'hash' => $hash,
], [
'detail' => Base::array2json(self::getDeviceInfo($_SERVER['HTTP_USER_AGENT'] ?? '')),
'expired_at' => $expiredAt,
]);
], function() use ($deviceData) {
if (!Request::hasHeader('version')) {
unset($deviceData['detail']);
}
return $deviceData;
}, $deviceData);
if ($row) {
Cache::put(self::ck($hash), $row->userid, now()->addHour());
return $row;

@ -1 +1 @@
Subproject commit 8e39dffb237dcf6091d75958f8decc07721a7950
Subproject commit 674b3ed99119bd02d2af3a2265bb7beab70ae2f0