1234567891011121314151617181920212223242526272829303132333435 |
- import request from '../api/request'
- import wx from 'weixin-js-sdk'
- const wxJs = () => request({
- method: 'GET',
- url: '/api/wechat/account/config',
- params: {
- url: location.href,
- official_account_code: 'tingbang' // 写死
- }
- })
- export const WxConfig = async () => {
- const { data } = await wxJs()
- console.log(data)
- let wxParam = {
- debug: false,
- appId: data.app_id,
- timestamp: data.timestamp,
- nonceStr: data.nonce_str,
- signature: data.signature,
- jsApiList: [
- 'checkJsApi',
- 'openLocation',
- 'getLocation',
- 'updateAppMessageShareData',
- 'updateTimelineShareData',
- 'onMenuShareAppMessage',
- 'onMenuShareTimeline',
- 'hideMenuItems',
- 'scanQRCode']
- }
- wx.config(wxParam)
- return wx
- }
|