From 7ae8f1026594f9aaa274834d68201292bef83f39 Mon Sep 17 00:00:00 2001 From: tq <1916474859@qq,com> Date: Sat, 12 Oct 2024 17:19:56 +0800 Subject: [PATCH] =?UTF-8?q?rfid=E8=AF=BB=E6=96=B9=E6=B3=95=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebStarter/Controllers/RfidController.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/WebStarter/Controllers/RfidController.cs b/WebStarter/Controllers/RfidController.cs index 63f7ed0..b496211 100644 --- a/WebStarter/Controllers/RfidController.cs +++ b/WebStarter/Controllers/RfidController.cs @@ -35,8 +35,12 @@ public class RfidController : ControllerBase [Route("ReadRfid")] public async Task> ReadRfid() { - RfidReadModel? rfidReadModel = await RfidApi.ReadRfid(); - if (rfidReadModel != null) return Result.Success(rfidReadModel, "读取成功"); + bool beginRead = await RfidApi.BeginRead(); + if (beginRead) + { + RfidReadModel? rfidReadModel = await RfidApi.ReadRfid(); + if (rfidReadModel != null) return Result.Success(rfidReadModel, "读取成功"); + } return Result.Fail(); } } \ No newline at end of file