/* * @Author: ch * @Date: 2022-04-28 16:30:54 * @LastEditors: ch * @LastEditTime: 2022-05-06 20:58:31 * @Description: file content */ import {ToAsyncAwait, MsbRequest, MsbRequestTk} from '@/common/utils'; const BASE_URL = '/mall/trade'; const APPID = 'wxd2015f0c56defa02'; /** * 获取授权页面地址 * @param {*} data */ export const ApiGetAuthUrl = (params) => ToAsyncAwait(MsbRequest.get(`${BASE_URL}/wx/mp/getAuthorizationUrl/${APPID}`, params)); /** * 获取openId * @param {*} data */ export const ApiGetOpenId = ({code}) => ToAsyncAwait(MsbRequest.get(`${BASE_URL}/wx/mp/getOpenId/${APPID}`, {code})); /** * 微信h5支付,获取支付URL * @param {*} data */ export const ApiPostWxH5Pay = (data) => ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/pay/wxPay/h5`, data)); /** * 微信JSAPI支付,获取支付参数 * @param {*} data */ export const ApiPostWxJsApiPay = (data) => ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/pay/wxPay/jsapi`, data)); /** * 微信APP支付 * @param {*} data */ export const ApiPostWxAppPay = (data) => ToAsyncAwait(MsbRequestTk.post(`${BASE_URL}/pay/wxPay/app`, data));