data.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import request from './request';
  2. //查询省
  3. export const getProvince = () => {
  4. return request({
  5. url: `area/PROVINCE`,
  6. method: 'get'
  7. })
  8. }
  9. //查询市
  10. export const getCityByPro = params => {
  11. return request({
  12. url: `area/CITY/${params.id}`,
  13. method: 'get'
  14. })
  15. }
  16. //查询区
  17. export const getDistrictByCity = params => {
  18. return request({
  19. url: `area/DISTRICT/${params.id}`,
  20. method: 'get'
  21. })
  22. }
  23. // 查询用户头像和昵称是否已存在
  24. export const findWxUserInfo = (params) => {
  25. return request({
  26. url: `wxuser/findWxUserInfo`,
  27. method: 'post',
  28. data:params
  29. }).then(res=>res.data)
  30. }
  31. // 更新用户头像和昵称信息
  32. export const wxUserUpdate = (params) => {
  33. return request({
  34. url: `wxuser/update`,
  35. method: 'post',
  36. data:params
  37. }).then(res=>res.data)
  38. }
  39. // 根据字典code查询选项
  40. export const getLookUpDatas = (params) => {
  41. return request({
  42. url: `lookup/findByLookup/${params.type}`,
  43. method: 'get'
  44. }).then(res=>res.data)
  45. }
  46. // 根据字典code查询所有数据
  47. export const getAllLookUpDatas = (params) => {
  48. return request({
  49. url: `lookup/findAllByLookup/${params.type}`,
  50. method: 'get'
  51. }).then(res=>res.data)
  52. }
  53. // 查询所有数据字典
  54. export const listLookUp = (params) => {
  55. let url = `lookup/findAll`
  56. return request({
  57. url: url,
  58. method: 'post'
  59. }).then(res=>res.data)
  60. }