云开发两个CloudID,本地调试偶尔出现数据混乱
发布于 6 年前 作者 jie36 10998 次浏览 来自 官方Issues

本地调试 同时提交userInfo和weRunData两个CloudID,云函数接收到的userInfo和weRunData数据有时候是错的

let reqData = {}
    wx.getUserInfo({
        withCredentials: true,
        lang: '',
        success: function (userInfoRes) {
            reqData['userInfo'] = wx.cloud.CloudID(userInfoRes.cloudID)
            wx.getWeRunData({
                success: function (weRunRes) {
                    console.log(weRunRes)
                    reqData['weRunData'] = wx.cloud.CloudID(weRunRes.cloudID)
                    wx.cloud.callFunction({
                        name: 'xxx',
                        data: reqData,
                        success: function (e) {
                            console.log(e)
                        }
                    })
                },
                fail: function (weRunRes) { },
                complete: function (weRunRes) { },
            })
        },
        fail: function (userInfoRes) { },
        complete: function (userInfoRes) { },
    })

结果

1 回复

麻烦提供一下appid和调用时间

回到顶部