diff --git a/src/api/system/area/index.ts b/src/api/system/area/index.ts new file mode 100644 index 0000000..3193d27 --- /dev/null +++ b/src/api/system/area/index.ts @@ -0,0 +1,19 @@ +import { http } from '@/http/http' + +/** 地区信息 */ +export interface Area { + id: number + name: string + parentId?: number + children?: Area[] +} + +/** 获得地区树 */ +export function getAreaTree() { + return http.get('/system/area/tree') +} + +/** 获得 IP 对应的地区名 */ +export function getAreaByIp(ip: string) { + return http.get(`/system/area/get-by-ip?ip=${ip}`) +}