public.service.js 2.3 KB

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