social.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import request from '@/sheep/request';
  2. const SocialApi = {
  3. // 获得社交用户
  4. getSocialUser: (type) => {
  5. return request({
  6. url: '/member/social-user/get',
  7. method: 'GET',
  8. params: {
  9. type
  10. },
  11. custom: {
  12. showLoading: false,
  13. },
  14. });
  15. },
  16. // 社交绑定
  17. socialBind: (type, code, state) => {
  18. return request({
  19. url: '/member/social-user/bind',
  20. method: 'POST',
  21. data: {
  22. type,
  23. code,
  24. state
  25. },
  26. custom: {
  27. custom: {
  28. showSuccess: true,
  29. loadingMsg: '绑定中',
  30. successMsg: '绑定成功',
  31. },
  32. },
  33. });
  34. },
  35. // 社交绑定
  36. socialUnbind: (type, openid) => {
  37. return request({
  38. url: '/member/social-user/unbind',
  39. method: 'DELETE',
  40. data: {
  41. type,
  42. openid
  43. },
  44. custom: {
  45. showLoading: false,
  46. loadingMsg: '解除绑定',
  47. successMsg: '解绑成功',
  48. },
  49. });
  50. },
  51. };
  52. export default SocialApi;