fix: 修复优化请求封装后获取摄像机画面截图请求异常的问题
This commit is contained in:
@@ -1,5 +1,9 @@
|
|||||||
export interface SnapResult {
|
export interface SnapResult {
|
||||||
|
code: number;
|
||||||
|
msg: string;
|
||||||
|
data: {
|
||||||
absoluteFilePath: string;
|
absoluteFilePath: string;
|
||||||
path: string;
|
path: string;
|
||||||
url: string;
|
url: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export const importCameraApi = async (file: File, options?: { stationCode?: Stat
|
|||||||
export const getCameraSnapApi = async (deviceId: string, options?: { signal?: AbortSignal }) => {
|
export const getCameraSnapApi = async (deviceId: string, options?: { signal?: AbortSignal }) => {
|
||||||
const { signal } = options ?? {};
|
const { signal } = options ?? {};
|
||||||
const endpoint = `/api/ndm/ndmCamera/getSnapByDeviceId`;
|
const endpoint = `/api/ndm/ndmCamera/getSnapByDeviceId`;
|
||||||
const resp = await ndmClient.get<SnapResult>(endpoint, { params: { deviceId }, signal });
|
const resp = await ndmClient.get<SnapResult>(endpoint, { params: { deviceId }, retRaw: true, signal });
|
||||||
const data = unwrapResponse(resp);
|
const data = unwrapResponse(resp);
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export const useCameraSnapColumn = (tableData: Ref<DataTableRowData[]>) => {
|
|||||||
loadingMap.value[id] = true;
|
loadingMap.value[id] = true;
|
||||||
try {
|
try {
|
||||||
const snap = await getSnapByDeviceId({ deviceAlarmLog: rowData });
|
const snap = await getSnapByDeviceId({ deviceAlarmLog: rowData });
|
||||||
rowData.snapUrl = snap.url;
|
rowData.snapUrl = snap.data.url;
|
||||||
} finally {
|
} finally {
|
||||||
loadingMap.value[id] = false;
|
loadingMap.value[id] = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user