third.js 1.1 KB

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