fix: 修复设备详情组合API返回undefined的问题
This commit is contained in:
@@ -20,40 +20,31 @@ export const detailDeviceApi = async (device: NdmDeviceResultVO, options?: { sta
|
|||||||
const deviceType = tryGetDeviceType(deviceTypeCode);
|
const deviceType = tryGetDeviceType(deviceTypeCode);
|
||||||
if (!deviceType) throw new Error('未知的设备');
|
if (!deviceType) throw new Error('未知的设备');
|
||||||
if (deviceType === DEVICE_TYPE_LITERALS.ndmAlarmHost) {
|
if (deviceType === DEVICE_TYPE_LITERALS.ndmAlarmHost) {
|
||||||
await detailAlarmHostApi(id, { stationCode, signal });
|
return await detailAlarmHostApi(id, { stationCode, signal });
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (deviceType === DEVICE_TYPE_LITERALS.ndmCamera) {
|
if (deviceType === DEVICE_TYPE_LITERALS.ndmCamera) {
|
||||||
await detailCameraApi(id, { stationCode, signal });
|
return await detailCameraApi(id, { stationCode, signal });
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (deviceType === DEVICE_TYPE_LITERALS.ndmDecoder) {
|
if (deviceType === DEVICE_TYPE_LITERALS.ndmDecoder) {
|
||||||
await detailDecoderApi(id, { stationCode, signal });
|
return await detailDecoderApi(id, { stationCode, signal });
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (deviceType === DEVICE_TYPE_LITERALS.ndmKeyboard) {
|
if (deviceType === DEVICE_TYPE_LITERALS.ndmKeyboard) {
|
||||||
await detailKeyboardApi(id, { stationCode, signal });
|
return await detailKeyboardApi(id, { stationCode, signal });
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (deviceType === DEVICE_TYPE_LITERALS.ndmMediaServer) {
|
if (deviceType === DEVICE_TYPE_LITERALS.ndmMediaServer) {
|
||||||
await detailMediaServerApi(id, { stationCode, signal });
|
return await detailMediaServerApi(id, { stationCode, signal });
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (deviceType === DEVICE_TYPE_LITERALS.ndmNvr) {
|
if (deviceType === DEVICE_TYPE_LITERALS.ndmNvr) {
|
||||||
await detailNvrApi(id, { stationCode, signal });
|
return await detailNvrApi(id, { stationCode, signal });
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (deviceType === DEVICE_TYPE_LITERALS.ndmSecurityBox) {
|
if (deviceType === DEVICE_TYPE_LITERALS.ndmSecurityBox) {
|
||||||
await detailSecurityBoxApi(id, { stationCode, signal });
|
return await detailSecurityBoxApi(id, { stationCode, signal });
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (deviceType === DEVICE_TYPE_LITERALS.ndmSwitch) {
|
if (deviceType === DEVICE_TYPE_LITERALS.ndmSwitch) {
|
||||||
await detailSwitchApi(id, { stationCode, signal });
|
return await detailSwitchApi(id, { stationCode, signal });
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (deviceType === DEVICE_TYPE_LITERALS.ndmVideoServer) {
|
if (deviceType === DEVICE_TYPE_LITERALS.ndmVideoServer) {
|
||||||
await detailVideoServerApi(id, { stationCode, signal });
|
return await detailVideoServerApi(id, { stationCode, signal });
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user