修正 心跳問題 20250702
This commit is contained in:
parent
b4957b99a0
commit
b68fa3e224
@ -172,12 +172,11 @@ class RoomControlController extends Controller
|
|||||||
|
|
||||||
if ($room->exists && $room->internal_ip !== $validated['ip']) {
|
if ($room->exists && $room->internal_ip !== $validated['ip']) {
|
||||||
$validated['status'] = 'error';
|
$validated['status'] = 'error';
|
||||||
$room->internal_ip = $validated['ip'];
|
|
||||||
} else {
|
} else {
|
||||||
$validated['status'] = 'online';
|
$validated['status'] = 'online';
|
||||||
$room->internal_ip ??= $validated['ip']; // 新的話補上
|
|
||||||
}
|
}
|
||||||
|
$room->internal_ip = $validated['ip'];
|
||||||
|
$room->port = 1000;
|
||||||
$room->is_online=1;
|
$room->is_online=1;
|
||||||
$room->touch(); // 更新 updated_at
|
$room->touch(); // 更新 updated_at
|
||||||
$room->save();
|
$room->save();
|
||||||
|
@ -22,8 +22,6 @@ class ReceiveRoomRegisterRequest extends ApiRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'room_name' => 'nullable|string',
|
|
||||||
'room_ip' => 'nullable|string',
|
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'password' => 'required',
|
'password' => 'required',
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user