Sfoglia il codice sorgente

feat:【system】地区管理:100%

YunaiV 4 mesi fa
parent
commit
aea01e4025
1 ha cambiato i file con 19 aggiunte e 0 eliminazioni
  1. 19 0
      src/api/system/area/index.ts

+ 19 - 0
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<Area[]>('/system/area/tree')
+}
+
+/** 获得 IP 对应的地区名 */
+export function getAreaByIp(ip: string) {
+  return http.get<string>(`/system/area/get-by-ip?ip=${ip}`)
+}