public.service.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /**
  2. * 这是所有模块公用业务逻辑的服务
  3. */
  4. export default class PublicService {
  5. constructor(AjaxService) {
  6. Object.assign(this, { AjaxService })
  7. this.name = 'PublicService'
  8. }
  9. /**
  10. * 获取地址
  11. */
  12. GetAllAddressData(data = {}) {
  13. return this.AjaxService.get({
  14. url: '/order/address/select/all',
  15. data,
  16. isLoading: false,
  17. })
  18. }
  19. /**
  20. * 获取图形验证码
  21. * platformType:小程序 2 WWW 0 CRM 1
  22. */
  23. GetImgVerifyCode(data = { platformType: 2 }) {
  24. return this.AjaxService.get({
  25. url: '/user/captcha',
  26. data,
  27. isLoading: true,
  28. })
  29. }
  30. /**
  31. * 获取图形验证码
  32. * activateCodeType:机构 2 供应商 3 找回密码 1
  33. */
  34. GetMobileCode(data = {}) {
  35. return this.AjaxService.get({
  36. url: '/user/activateCodeByReg',
  37. data,
  38. isLoading: true
  39. })
  40. }
  41. /**
  42. * 获取图形验证码
  43. * activateCodeType:机构 2 供应商 3 找回密码 1
  44. */
  45. GetMobileCode(data = {}) {
  46. return this.AjaxService.get({
  47. url: '/user/activateCodeByReg',
  48. data,
  49. isLoading: true
  50. })
  51. }
  52. /**
  53. * 获取手机短信验证码
  54. * isCheckCaptcha 是否需要图形验证码:1:不检查 , 0:检查
  55. * mobile 手机号
  56. * activateCodeType 短信类型 :1:找回密码, 2:手机号注册机构, 3:供应商注册 6:二手发布
  57. * imgCode 图片验证码
  58. * token 图片验证码token
  59. * platformType: 来源:0:www,1:crm/h5,2:小程序
  60. */
  61. GetRegisterMobileCode(data = {}) {
  62. return this.AjaxService.get({
  63. url: '/user/sms/code',
  64. data,
  65. isLoading: true,
  66. })
  67. }
  68. /**
  69. * 获取邮箱短信验证码
  70. * email 邮箱
  71. * status 1:绑定邮箱,2邮箱注册,3邮箱找回秘密
  72. */
  73. GetUserEmailCode(data = {}) {
  74. return this.AjaxService.get({
  75. url: '/user/mail/code',
  76. data,
  77. isLoading: true,
  78. })
  79. }
  80. /**
  81. * 获取手机短信验证码
  82. * bindMobile 机构手机号
  83. * isCheckCaptcha 是否需要图形验证码:1:检查 , 0:不检查z
  84. * mobile 运营人员手机号
  85. * userId 机构用户UserId
  86. * imgCode 图片验证码
  87. * token 图片验证码token
  88. * platformType: 来源:0:www,1:crm/h5,2:小程序
  89. */
  90. GetBindMobileCode(data = {}) {
  91. return this.AjaxService.get({
  92. url: '/user/sms/bind',
  93. data,
  94. isLoading: true,
  95. })
  96. }
  97. /**
  98. * 协议
  99. */
  100. getProtocol(data) {
  101. return this.AjaxService.get({
  102. url: '/user/center/protocol',
  103. data,
  104. isLoading: true ,
  105. })
  106. }
  107. }