public.service.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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:'/club/address',
  15. data,
  16. isLoading: true ,
  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. isHost:true
  29. })
  30. }
  31. /**
  32. * 获取图形验证码
  33. * activateCodeType:机构 2 供应商 3 找回密码 1
  34. */
  35. GetMobileCode (data = {}) {
  36. return this.AjaxService.get({
  37. url:'/user/activateCodeByReg',
  38. data,
  39. isLoading: true
  40. })
  41. }
  42. /**
  43. * 获取图形验证码
  44. * activateCodeType:机构 2 供应商 3 找回密码 1
  45. */
  46. GetMobileCode (data = {}) {
  47. return this.AjaxService.get({
  48. url:'/user/activateCodeByReg',
  49. data,
  50. isLoading: true
  51. })
  52. }
  53. /**
  54. * 获取手机短信验证码
  55. * isCheckCaptcha 是否需要图形验证码:1:检查 , 0:不检查
  56. * mobile 手机号
  57. * activateCodeType 短信类型 :1:找回密码, 2:手机号注册机构, 3:供应商注册
  58. * imgCode 图片验证码
  59. * token 图片验证码token
  60. * platformType: 来源:0:www,1:crm/h5,2:小程序
  61. */
  62. GetRegisterMobileCode (data = {}) {
  63. return this.AjaxService.get({
  64. url:'/user/sms/code',
  65. data,
  66. isLoading: true,
  67. isHost:true
  68. })
  69. }
  70. /**
  71. * 获取邮箱短信验证码
  72. * email 邮箱
  73. * status 1:绑定邮箱,2邮箱注册,3邮箱找回秘密
  74. */
  75. GetUserEmailCode (data = {}) {
  76. return this.AjaxService.get({
  77. url:'/user/mail/code',
  78. data,
  79. isLoading: true,
  80. isHost:true
  81. })
  82. }
  83. /**
  84. * 获取手机短信验证码
  85. * bindMobile 机构手机号
  86. * isCheckCaptcha 是否需要图形验证码:1:检查 , 0:不检查z
  87. * mobile 运营人员手机号
  88. * userId 机构用户UserId
  89. * imgCode 图片验证码
  90. * token 图片验证码token
  91. * platformType: 来源:0:www,1:crm/h5,2:小程序
  92. */
  93. GetBindMobileCode (data = {}) {
  94. return this.AjaxService.get({
  95. url:'/user/sms/bind',
  96. data,
  97. isLoading: true,
  98. isHost:true
  99. })
  100. }
  101. }