import axios from '@/request/http.js' // 引入封装之后的http中创建的axios实例
import store from '@/store/index.js'

let paramUrl = location.href.split('#')[0] // 获取锚点之前的链接
let companyId = store.state.companyId

const wxCommonApi = {
    getWxJsdkPermission () {
        return axios.get('/api/WxCommon/GetWxJsdkPermission', {
            params: {
                Url: paramUrl
            }
        })
    },
    // 获取微信jsdk,不带token
    getNotTokenOfWxJsdkPermission () {
        return axios.get(`/api/WxCommon/GetAnonymousWxJsdk/${companyId}`, {
            params: {
                Url: paramUrl
            },
            isToken: false
        })
    },
    // 获取微信参数二维码
    getWeixinParamQRCode (params) {
        return axios.get(`/api/WxCommon/GetWeixinParamQRCode/${params.module_code}/${params.b_id}`)
    }

}
export default wxCommonApi
