third.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import request from '@/sheep/request';
  2. const socialType = 34; // 社交类型 - 微信小程序
  3. export default {
  4. // 微信相关
  5. wechat: {
  6. // 小程序订阅消息
  7. subscribeTemplate: (params) =>
  8. request({
  9. url: 'third/wechat/subscribeTemplate',
  10. method: 'GET',
  11. params: {
  12. platform: 'miniProgram',
  13. },
  14. custom: {
  15. showError: false,
  16. showLoading: false,
  17. },
  18. }),
  19. // 获取微信小程序码
  20. getWxacode: async (path, query) => {
  21. return await request({
  22. url: '/member/social-user/wxa-qrcode',
  23. method: 'POST',
  24. data: {
  25. type: socialType,
  26. scene: query,
  27. isCheckPath: false, // TODO 开发环境暂不检查 path 是否存在
  28. path,
  29. },
  30. });
  31. },
  32. },
  33. // 苹果相关
  34. apple: {
  35. // 第三方登录
  36. login: (data) =>
  37. request({
  38. url: 'third/apple/login',
  39. method: 'POST',
  40. data,
  41. custom: {
  42. showSuccess: true,
  43. loadingMsg: '登陆中',
  44. },
  45. }),
  46. },
  47. };