From a61dfeddb006e7151a588a0e75b14bb0f0592450 Mon Sep 17 00:00:00 2001 From: yanghongwei Date: Thu, 11 Sep 2025 00:51:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/DeviceService.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Service/DeviceService.cs b/Service/DeviceService.cs index a6b53c1..ccb9e2e 100644 --- a/Service/DeviceService.cs +++ b/Service/DeviceService.cs @@ -47,12 +47,10 @@ namespace LY.App.Service .WhereIF(!string.IsNullOrEmpty(key), s => s.Name.Contains(key) || s.DeviceSN.Contains(key)) .OrderByDescending(s => s.Id) .ToPageListAsync(pageNum, pageSize, total); - - items.ForEach(async s => + foreach (var item in items) { - var status = await _redisService.ExistsAsync(RedisKeyList.DeviceStatus(s.DeviceSN)); - s.online = status; - }); + item.online = await _redisService.ExistsAsync(RedisKeyList.DeviceStatus(item.DeviceSN)); + } return new ApiResult() { data = new