收藏
回答

为何KVDataList为空?

var kvDataList = new Array();
kvDataList.push({ key: "score2", value: "88888" });
wx.setUserCloudStorage({
  KVDataList: kvDataList,
  success: res => {
    console.log(res)
    // console.log(res.data)
    //主域
  },
  fail: res => {
    console.log(res);
  }
})
wx.getFriendCloudStorage({
  KeyList: ['score2'],
  success: res => {
 
    console.log(res.data)
    //子域
    //drawRankList(data)
 
  }
 
})

Console里面能够显示账号的记录,但KVDataListArray(0),求解

回答关注问题邀请回答
收藏

1 个回答

  • OzG
    OzG
    2019-01-16

    同问,帮顶

    2019-01-16
    有用
    回复 2
    • 2019-01-16

      已经解决 尝试这样

      var arr = new Array();
             arr.push({ key: "score", value: ""+data.scr });
             arr.push({ key: "coin", value: "100000" });
             wx.setUserCloudStorage(
               {
                 KVDataList: arr,
                 success:
                   function (res) {
       
                     console.log("-------存储成功-----:");
                     console.log(res);
                   },
                 fail: function (res) { console.error(res); },
                 complete(res) { }
               });


      2019-01-16
      回复
    • OzG
      OzG
      2019-01-16回复

      好的,我去试试,万分感谢!

      2019-01-16
      回复
登录 后发表内容