Files
xian_vue_new/src/api/api.ts
T

24 lines
802 B
TypeScript
Raw Normal View History

2026-04-11 10:09:40 +08:00
import type { DisasterType } from '@/types/common/DisasterType'
2026-04-07 20:01:06 +08:00
import { getSm2PublicKey } from './crypto'
2026-04-11 10:09:40 +08:00
import { getBasePoins, getPointDetailById } from './hidden-danger-spots'
import type { ApiResponse } from '@/types/ApiResponse'
import type { XianHiddenDangerSpots } from '@/types/base/XianHiddenDangerSpots'
2026-04-07 20:01:06 +08:00
export const $api = {
// 加密模块
crypto: {
// 获取sm2公钥
getSm2PublicKey: () => getSm2PublicKey(),
},
2026-04-11 10:09:40 +08:00
// 隐患点信息
hiddenDangerSpots: {
// 获取所有基础隐患点
getBasePoins: (disasterType: DisasterType): Promise<ApiResponse<XianHiddenDangerSpots[]>> => getBasePoins(disasterType),
// 根据id获取隐患点详情
getPointDetailById: (id: number): Promise<ApiResponse<XianHiddenDangerSpots>> => getPointDetailById(id),
},
2026-04-07 20:01:06 +08:00
}