From 95063845500442a8d5545f80d93e828b7c7b41ed Mon Sep 17 00:00:00 2001 From: EasyChen Date: Fri, 21 Jan 2022 13:18:39 +0800 Subject: [PATCH] add device type --- api/app/Http/Controllers/PushDeerDeviceController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/app/Http/Controllers/PushDeerDeviceController.php b/api/app/Http/Controllers/PushDeerDeviceController.php index 868cc3a..a292b48 100644 --- a/api/app/Http/Controllers/PushDeerDeviceController.php +++ b/api/app/Http/Controllers/PushDeerDeviceController.php @@ -25,6 +25,7 @@ class PushDeerDeviceController extends Controller 'name' => 'string', 'device_id' => 'string', 'is_clip' => 'integer', + 'type' => 'string|nullable', ] ); @@ -33,10 +34,15 @@ class PushDeerDeviceController extends Controller return send_error('uid错误', ErrorCode('ARGS')); } + $type = 'ios'; + if (strlen($validated['type']) > 0) { + $type = trim($validated['type']); + } + $the_device = []; $the_device['uid'] = $uid; $the_device['name'] = $validated['name']; - $the_device['type'] = 'all'; + $the_device['type'] = $type; $the_device['is_clip'] = intval($validated['is_clip']); $the_device['device_id'] = $validated['device_id'];