mirror of
https://github.com/kuaifan/dootask.git
synced 2026-01-21 00: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 Carbon\Carbon;
|
||||||
use DeviceDetector\DeviceDetector;
|
use DeviceDetector\DeviceDetector;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
use Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* App\Models\UserDevice
|
* App\Models\UserDevice
|
||||||
@ -219,15 +220,21 @@ class UserDevice extends AbstractModel
|
|||||||
$userid = $info['userid'] ?? 0;
|
$userid = $info['userid'] ?? 0;
|
||||||
$expiredAt = $info['expired_at'] ?? null;
|
$expiredAt = $info['expired_at'] ?? null;
|
||||||
}
|
}
|
||||||
|
$deviceData = [
|
||||||
|
'detail' => Base::array2json(self::getDeviceInfo($_SERVER['HTTP_USER_AGENT'] ?? '')),
|
||||||
|
'expired_at' => $expiredAt,
|
||||||
|
];
|
||||||
|
|
||||||
$hash = md5($token);
|
$hash = md5($token);
|
||||||
$row = self::updateInsert([
|
$row = self::updateInsert([
|
||||||
'userid' => $userid,
|
'userid' => $userid,
|
||||||
'hash' => $hash,
|
'hash' => $hash,
|
||||||
], [
|
], function() use ($deviceData) {
|
||||||
'detail' => Base::array2json(self::getDeviceInfo($_SERVER['HTTP_USER_AGENT'] ?? '')),
|
if (!Request::hasHeader('version')) {
|
||||||
'expired_at' => $expiredAt,
|
unset($deviceData['detail']);
|
||||||
]);
|
}
|
||||||
|
return $deviceData;
|
||||||
|
}, $deviceData);
|
||||||
if ($row) {
|
if ($row) {
|
||||||
Cache::put(self::ck($hash), $row->userid, now()->addHour());
|
Cache::put(self::ck($hash), $row->userid, now()->addHour());
|
||||||
return $row;
|
return $row;
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 8e39dffb237dcf6091d75958f8decc07721a7950
|
Subproject commit 674b3ed99119bd02d2af3a2265bb7beab70ae2f0
|
||||||
Loading…
x
Reference in New Issue
Block a user