Commit 2f7f426c authored by 马33's avatar 马33

修改bug

parent 325bc153
...@@ -78,7 +78,11 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme ...@@ -78,7 +78,11 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
wrapper.eq(Device::getSnBind, snBind).last("limit 1"); wrapper.eq(Device::getSnBind, snBind).last("limit 1");
Device deviceTemp = deviceMapper.selectOne(wrapper); Device deviceTemp = deviceMapper.selectOne(wrapper);
if (deviceTemp != null) { if (deviceTemp != null) {
throw new IotLicenseException(403, "该设备已绑定了" + deviceTemp.getSn()); if (deviceTemp.getSn().equals(sn)) {
return true;
} else {
throw new IotLicenseException(403, "该设备已绑定了" + deviceTemp.getSn());
}
} }
LambdaQueryWrapper<Device> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Device> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Device::getSn, sn).last("limit 1"); queryWrapper.eq(Device::getSn, sn).last("limit 1");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment