You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
/*
* @Author: ch
* @Date: 2022-04-28 16:30:54
* @LastEditors: ch
* @LastEditTime: 2022-05-17 20:07:26
* @Description: file content
*/
import { ToAsyncAwait , MsbRequest , MsbRequestTk } from '@/common/utils' ;
const BASE _URL = '/mall/trade' ;
// 第三方鉴权服务
const AUTH _URL = '/third' ;
const APPID = 'wxd2015f0c56defa02' ;
/**
* 获取授权页面地址
* @param {*} data
*/
export const ApiGetAuthUrl = ( params ) =>
ToAsyncAwait ( MsbRequest . get ( ` ${ AUTH _URL } /wx/mp/getAuthorizationUrl/ ${ APPID } ` , params ) ) ;
/**
* 获取openId
* @param {*} data
*/
export const ApiGetOpenId = ( { code } ) =>
ToAsyncAwait ( MsbRequest . get ( ` ${ AUTH _URL } /wx/mp/getOpenId/ ${ APPID } ` , { code } ) ) ;
/**
* 微信OPENID绑定用户
* @param {*} data
*/
export const ApiPostThirdInfo = ( data ) =>
ToAsyncAwait ( MsbRequestTk . post ( ` ${ AUTH _URL } /third/saveThirdInfo ` , { ... data , appId : APPID } ) ) ;
/**
* 微信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 ) ) ;