UNPKG

@tplc/business

Version:

36 lines (30 loc) 775 B
import { IResData } from 'action' import type { LightMapConfig, MapDetail } from './types' /** * 获取地图配置列表 */ export const getMapConfigListApi = async () => { const { data } = (await uni.$lcb.http.post('/clockLightConfig/list', {}, true)) as IResData< LightMapConfig[] > const list = data.map( (item) => ({ ...item, mapConfig: JSON.parse(`${item.mapConfig}`), }) as LightMapConfig, ) return list } /** * 获取地图详细信息 * @param clockLightConfigId 地图配置ID */ export const getMapDetailApi = async (clockLightConfigId: string) => { const { data } = (await uni.$lcb.http.post( '/clockLightUser/detail', { clockLightConfigId }, true, )) as IResData<MapDetail> return data }