import { http } from "@/utils/http"; import { faker } from "@faker-js/faker/locale/zh_CN"; type Result = { success: boolean; data: Array; }; type mapType = { plateNumber: string; driver: string; orientation: number; lng: number; lat: number; }; const mapList = (): Array => { const result: Array = []; for (let index = 0; index < 10; index++) { result.push({ plateNumber: `豫A${faker.string.numeric({ length: 5 })}${faker.string.alphanumeric({ casing: "upper" })}`, driver: faker.person.firstName(), orientation: faker.number.int({ min: 1, max: 360 }), lng: faker.location.latitude({ max: 114.1, min: 113 }), lat: faker.location.latitude({ max: 35.1, min: 34 }) }); } return result; }; /** 地图数据 */ // export const mapJson = (params?: object) => { // return http.request("get", "/get-map-info", { params }); // }; /** 地图数据 */ export const mapJson = (params?: object) => { return { success: true, data: mapList() }; }; /** 文件上传 */ export const formUpload = data => { return http.request( "post", "https://run.mocky.io/v3/3aa761d7-b0b3-4a03-96b3-6168d4f7467b", { data }, { headers: { "Content-Type": "multipart/form-data" } } ); };