mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-29 02:33:56 +08:00
修复:固件要求firmware的url不能为空
This commit is contained in:
@@ -200,4 +200,9 @@ public interface Constant {
|
|||||||
* 版本号
|
* 版本号
|
||||||
*/
|
*/
|
||||||
public static final String VERSION = "0.4.3";
|
public static final String VERSION = "0.4.3";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 无效固件URL
|
||||||
|
*/
|
||||||
|
String INVALID_FIRMWARE_URL = "http://xiaozhi.server.com:8002/xiaozhi/otaMag/download/NOT_ACTIVATED_FIRMWARE_THIS_IS_A_INVALID_URL";
|
||||||
}
|
}
|
||||||
+2
-2
@@ -142,7 +142,7 @@ public class DeviceServiceImpl extends BaseServiceImpl<DeviceDao, DeviceEntity>
|
|||||||
if (deviceById == null) {
|
if (deviceById == null) {
|
||||||
DeviceReportRespDTO.Firmware firmware = new DeviceReportRespDTO.Firmware();
|
DeviceReportRespDTO.Firmware firmware = new DeviceReportRespDTO.Firmware();
|
||||||
firmware.setVersion(deviceReport.getApplication().getVersion());
|
firmware.setVersion(deviceReport.getApplication().getVersion());
|
||||||
firmware.setUrl("http://xiaozhi.server.com:8002/xiaozhi/otaMag/download/NOT_ACTIVATED_FIRMWARE_THIS_IS_A_INVALID_URL");
|
firmware.setUrl(Constant.INVALID_FIRMWARE_URL);
|
||||||
response.setFirmware(firmware);
|
response.setFirmware(firmware);
|
||||||
} else {
|
} else {
|
||||||
// 只有在设备已绑定且autoUpdate不为0的情况下才返回固件升级信息
|
// 只有在设备已绑定且autoUpdate不为0的情况下才返回固件升级信息
|
||||||
@@ -378,7 +378,7 @@ public class DeviceServiceImpl extends BaseServiceImpl<DeviceDao, DeviceEntity>
|
|||||||
}
|
}
|
||||||
|
|
||||||
firmware.setVersion(ota == null ? currentVersion : ota.getVersion());
|
firmware.setVersion(ota == null ? currentVersion : ota.getVersion());
|
||||||
firmware.setUrl(downloadUrl == null ? "" : downloadUrl);
|
firmware.setUrl(downloadUrl == null ? Constant.INVALID_FIRMWARE_URL : downloadUrl);
|
||||||
return firmware;
|
return firmware;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user