fix 调整无授权处理,增加检查设备是否存在接口
This commit is contained in:
@@ -35,9 +35,10 @@ public class DeviceConnectService : IDeviceConnectService
|
||||
RegisterTime = DateTime.Now,
|
||||
BusinessPlaceCode = businessPlace?.Code,
|
||||
BusinessPlaceCustomCode = businessPlace?.CustomCode,
|
||||
TenantId = device.TenantId,
|
||||
};
|
||||
await _dbContext.InsertAsync(registry);
|
||||
|
||||
await _dbContext.InsertAsync(registry);
|
||||
return "设备注册成功";
|
||||
}
|
||||
|
||||
@@ -93,8 +94,8 @@ public class DeviceConnectService : IDeviceConnectService
|
||||
private async Task<DeviceEntity> GetEnableDeviceAsync(string uniqueNo)
|
||||
{
|
||||
var device = await _dbContext.Queryable<DeviceEntity>()
|
||||
.Where(x => x.UniqueNo == uniqueNo)
|
||||
.FirstAsync();
|
||||
.Where(x => x.UniqueNo == uniqueNo)
|
||||
.FirstAsync();
|
||||
|
||||
device.ThrowIfNull($"未知的设备唯一编码{uniqueNo}");
|
||||
device.Enable.ThrowIfFalse("设备尚未启用");
|
||||
|
||||
Reference in New Issue
Block a user