index.ts 572 B

12345678910111213141516171819
  1. import request from '@/config/axios'
  2. // 获得地区树
  3. export const getAreaTree = async () => {
  4. return await request.get({ url: '/system/area/tree' })
  5. }
  6. export const getChildrenArea = async (id: number) => {
  7. return await request.get({ url: '/system/area/get-children?id=' + id })
  8. }
  9. export const getAreaListByIds = async (ids) => {
  10. return await request.get({ url: '/system/area/get-by-ids?ids=' + ids })
  11. }
  12. // 获得 IP 对应的地区名
  13. export const getAreaByIp = async (ip: string) => {
  14. return await request.get({ url: '/system/area/get-by-ip?ip=' + ip })
  15. }