Page({
data: {
webUrl: getApp().globalData.webUrl,
user_Id: wx.getStorageSync('user_Id'),
token: wx.getStorageSync('token')
},
onShareAppMessage: function () {
const promise = new Promise(resolve => {
wx.request({
url: this.data.webUrl,
data: {
user_Id: this.data.user_Id
},
header: {
'content-type': 'application/json',
'token': this.data.token
},
method: 'POST',
success(res) {
resolve({
title: '自定义转发标题'
})
},
fail: (err:any) => {
resolve({
title: '失败标题',
})
return;
}
})
})
return {
title: '默认转发标题',
path: '/page/user?id=123',
promise
}
},
})