data.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. // 获取用户信息
  40. export const getCurrUserInfo = (params) => {
  41. return request({
  42. url: 'employee/findCurrent',
  43. data:params,
  44. method: 'get'
  45. })
  46. }
  47. // 根据字典code查询选项
  48. export const getLookUpDatas = (params) => {
  49. return request({
  50. url: `lookup/findByLookup/${params.type}`,
  51. method: 'get'
  52. })
  53. }
  54. // 根据字典code查询所有数据
  55. export const getAllLookUpDatas = (params) => {
  56. return request({
  57. url: `lookup/findAllByLookup/${params.type}`,
  58. method: 'get'
  59. })
  60. }
  61. // 查询所有数据字典
  62. export const listLookUp = (params) => {
  63. let url = `lookup/findAll`
  64. return request({
  65. url: url,
  66. method: 'post'
  67. })
  68. }
  69. // 发送验证码
  70. export const sendPhoneVerifyCode = (params) => {
  71. let url = `mobileVerifyCode/sendCode`
  72. return request({
  73. url: url,
  74. data: params,
  75. method: 'post'
  76. })
  77. }
  78. // 验证验证码输入是否正确
  79. export const verifyPhoneCode = (params) => {
  80. let url = `mobileVerifyCode/verifyCode`
  81. return request({
  82. url: url,
  83. data: params,
  84. method: 'post'
  85. })
  86. }