share.js 475 Bytes
Newer Older
1 2
import { getWXObject, getSignature } from './base'

FE committed
3
const shareApiList = ['updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage', 'onMenuShareTimeline']
4

FE committed
5
export default async function (data = {title: '', desc: '', link: '', imgUrl: ''}, config = {}) {
6
    await getWXObject()
FE committed
7
    await getSignature(config)
8 9 10 11 12 13 14 15

    wx.ready(function () {
        console.log('ready');
        shareApiList.forEach(item => {
            wx[item](data)
        })
    })
}