mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-08 22:18:11 +00:00
no message
This commit is contained in:
parent
c51870ff79
commit
92c4565590
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user