Files
ndm-web-platform/src/apis/request/biz/log/ndm-icmp-log.ts
yangsy 9af76bacbb refactor: 优化请求封装
- 优化Result接口定义
- 新增响应数据解析逻辑
- 优化错误解析逻辑
2025-12-24 22:34:53 +08:00

13 lines
712 B
TypeScript

import { ndmClient, userClient, type NdmIcmpLogPageQuery, type NdmIcmpLogResultVO, type PageParams, type PageResult, type Station } from '@/apis';
import { unwrapResponse } from '@/utils';
export const pageIcmpLogApi = async (pageQuery: PageParams<NdmIcmpLogPageQuery>, options?: { stationCode?: Station['code']; signal?: AbortSignal }) => {
const { stationCode, signal } = options ?? {};
const client = stationCode ? ndmClient : userClient;
const prefix = stationCode ? `/${stationCode}` : '';
const endpoint = `${prefix}/api/ndm/ndmIcmpLog/page`;
const resp = await client.post<PageResult<NdmIcmpLogResultVO>>(endpoint, pageQuery, { signal });
const data = unwrapResponse(resp);
return data;
};