xfqwdsj

我需要写一个排行榜 是循环从服务器取数据的 但是会出现服务器还没返回数据就进入下一次循环 我是这样做的: $(ouser).each(function(index) { user.get(ouser[index]).then(function(userres) { query.equalTo("userid", ouser[index]) query.descending("speed") query.first().then(function(object) { ouser[index] = userres.get("username") lb.push(new Array(ouser[in…

另外一种思路 把所有要请求的数据都保存在数组里再用是不是好一些?

最后我还是迫不得已用了这种方式等待返回值 var a = function() { if(已返回) { //逻辑 } else { setTimeout(a, 时间) } } a()

这样的话 我就不得不离开sdk了嘛?

我大概懂了 其实用 then 就可以了是嘛?

以下是我的代码 throw new AVException(202, history); 其中 history 为String型变量 以下是我收到的错误信息 image.png 719x197 25.5 KB

补充: @EngineHook(className = "xxx", type = EngineHookType.beforeSave) public static AVObject xxx(AVObject object) throws Exception { //xxx throw new AVException(202, history); }