wx.js 742 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import request from '@/utils/request'
  2. // #ifdef H5
  3. // 微信分享信息
  4. export function share(data) {
  5. return request({
  6. url: '/api/share',
  7. method: 'get',
  8. data
  9. });
  10. }
  11. //微信配置
  12. export function wechatConfig(data) {
  13. return request({
  14. url: '/api/wechat/config',
  15. method: 'get',
  16. data
  17. });
  18. }
  19. // 微信code地址
  20. export function wechatAuth(data) {
  21. return request({
  22. url: '/api/wechat/auth',
  23. method: 'get',
  24. data
  25. });
  26. }
  27. //获取openid
  28. export function getOpenId(data) {
  29. return request({
  30. url: '/api/wechat/getopenid',
  31. method: 'get',
  32. data
  33. });
  34. }
  35. // #endif
  36. // #ifdef MP-WEIXIN
  37. // 微信code地址
  38. export function wechatMpAuth(data) {
  39. return request({
  40. url: '/api/wechat/mp_auth',
  41. method: 'post',
  42. data
  43. });
  44. }
  45. // #endif