修正 心跳問題 20250702

This commit is contained in:
allen.yan 2025-07-02 18:36:34 +08:00
parent b4957b99a0
commit b68fa3e224
2 changed files with 2 additions and 5 deletions

View File

@ -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();

View File

@ -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',
]; ];