分享成功以后调用API不工作,但是开发版本可以工作
onShareAppMessage: function () { const id = this.data.id; return { ...this.data.shareData, success: res => { // 转发成功 wx.showLoading({ title: "复活中...", mask: true }); service({ ...Share, data: { id: id } }) .then(resp => { wx.hideLoading(); wx.redirectTo({ url: "../index?id=" + id }); }) .catch(error => { wx.hideLoading(); wx.showToast({ title: "复活失败", icon: "none" }); }); }, fail: res => { // 转发失败 wx.showToast({ title: "复活失败", icon: "none" }); } }; } |
如题,代码如上,为什么我开发环境可以工作,但是发布以后就不能工作了
