user.js 998 B

1234567891011121314151617181920212223242526272829303132
  1. import request from './request.js';
  2. // 查询地址下拉树结构 -- 到小区
  3. const addrTreeSelect = async (data) => {
  4. const res = await request.get({ url: `/api/wx/addr/tree`, data });
  5. return res.data;
  6. }
  7. // 楼栋查询
  8. const buildingList = async (data) => {
  9. const res = await request.get({ url: `/wx/addr/buildings`, data });
  10. return res.data;
  11. }
  12. // 住宅查询
  13. const houseList = async (data) => {
  14. const res = await request.get({ url: `/wx/addr/houses`, data });
  15. return res.data;
  16. }
  17. // 添加用户信息
  18. const addUser = async (data) => {
  19. const res = await request.post({ url: `/api/user/register`, data });
  20. return res.data;
  21. }
  22. // 添加用户信息
  23. const updateUser = async (data) => {
  24. const res = await request.post({ url: `/api/user/edit`, data });
  25. return res.data;
  26. }
  27. // 获取用户信息
  28. const getUser = async () => {
  29. const res = await request.get({ url: `/user/info` });
  30. return res.data;
  31. }
  32. export default { addrTreeSelect, buildingList, houseList, addUser, getUser, updateUser };