weixin.js 617 B

123456789101112131415161718192021222324252627282930313233343536
  1. import request from '@/utils/request'
  2. import requestWhite from '../utils/requestWhite.js';
  3. import Qs from 'qs';
  4. //微信支付
  5. export function wxpay(orderId) {
  6. return request({
  7. url: '/wxPay/wxJsapiPay',
  8. data: {
  9. chargingMarketingId: orderId
  10. },
  11. method: 'post',
  12. })
  13. }
  14. //根据code换取openid
  15. export function getDataByCode(code) {
  16. return request({
  17. url: '/wechat/findUserInfo/' + code,
  18. params: {},
  19. method: 'get',
  20. })
  21. }
  22. //获得配置
  23. export function getConfig() {
  24. return requestWhite({
  25. url: '/wechat/getConfig',
  26. data: {
  27. url: window.location.href.split('#')[0]
  28. },
  29. method: 'get',
  30. })
  31. }