memberLogin.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import { requestApi } from '../util/network'
  2. // 用户登录
  3. export const login =
  4. (userName, password, pictureCode = '') =>
  5. requestApi(
  6. '/Login/index',
  7. 'POST',
  8. {
  9. 'username': userName,
  10. 'password': password,
  11. 'captcha': pictureCode,
  12. 'client_type': 'wap'
  13. }
  14. )
  15. // 用户微信登录
  16. export const wechatLogin =
  17. (ref, inviterId) =>
  18. requestApi(
  19. '/Wxauto/login',
  20. 'GET',
  21. {
  22. 'ref': ref,
  23. 'inviter_id': inviterId
  24. }
  25. )
  26. // 用户微信登录
  27. export const wechatcheck =
  28. (data) =>
  29. requestApi(
  30. '/Wxauto/checkAuth',
  31. 'GET',
  32. data
  33. )
  34. // 用户微信登录
  35. export const wechatUser =
  36. (data) =>
  37. requestApi(
  38. '/Wxauto/getUser',
  39. 'GET',
  40. data
  41. )
  42. // 用户手机登录
  43. export const LoginByMobile =
  44. (phone, captcha) =>
  45. requestApi(
  46. '/Connect/sms_login',
  47. 'POST',
  48. {
  49. 'usermobile': phone,
  50. 'mobilecode': captcha,
  51. 'client': 'wap'
  52. }
  53. )
  54. // 绑定
  55. export const bind =
  56. (type, from, openid, unionid, nickname, headimgurl, user, password, password2, inviter_id) =>
  57. requestApi(
  58. '/Login/bind',
  59. 'POST',
  60. {
  61. type: type,
  62. from: from,
  63. openid: openid,
  64. unionid: unionid,
  65. nickname: nickname,
  66. headimgurl: headimgurl,
  67. user: user,
  68. password: password,
  69. password2: password2,
  70. inviter_id: inviter_id,
  71. client_type: 'wap'
  72. }
  73. )
  74. export const getThirdLogin =
  75. (id) =>
  76. requestApi(
  77. '/Login/third_login',
  78. 'POST',
  79. {
  80. id:id
  81. }
  82. )