fix: 修复当API接口定义中没有响应数据时会意外抛出空数据异常的问题
This commit is contained in:
@@ -10,7 +10,7 @@ import {
|
||||
type PageResult,
|
||||
type Station,
|
||||
} from '@/apis';
|
||||
import { unwrapResponse } from '@/utils';
|
||||
import { unwrapResponse, unwrapVoidResponse } from '@/utils';
|
||||
|
||||
export const postNdmMediaServerPage = async (pageQuery: PageParams<NdmMediaServerPageQuery>, options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
|
||||
const { stationCode, signal } = options ?? {};
|
||||
@@ -90,5 +90,5 @@ export const probeMediaServerApi = async (ids: string[], options?: { stationCode
|
||||
const prefix = stationCode ? `/${stationCode}` : '';
|
||||
const endpoint = `${prefix}/api/ndm/ndmMediaServer/probeByIds`;
|
||||
const resp = await client.post<void>(endpoint, ids, { signal });
|
||||
unwrapResponse(resp);
|
||||
unwrapVoidResponse(resp);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user