本帖最后由 laodu 于 2015-11-12 15:18 编辑
一台iphone6 ios9,三星、小米、华为等多台安卓,任意程序,同一个wifi下面,只要iphone调用一次api.ajax,马上在安卓端再调用api.ajax,100%出现网络请求超时,等一段时间,安卓端恢复正常,请帮忙解决一下! api.ajax调用函数:
/**
* Created by Administrator on 2014/12/17.
*/
/**
*
* Secure Hash Algorithm (SHA1)
* http://www.webtoolkit.info/
*
**/
function SHA1(msg){}
function ajaxRequest(url, method, bodyParam, callBack) {
var common_url = 'https://d.apicloud.com/mcm/api';
var appId = 'A699285xxxxxxx';
var key = '43C21872-EBF2-96B9-759D-Dxxxxxxxxx';
var now = Date.now();
var appKey = SHA1(appId + "UZ" + key + "UZ" + now) + "." + now;
api.ajax({
url : common_url + url,
method : method,
//cache : false,
timeout : 20,
headers : {
//"Content-type" : "application/json;charset=UTF-8",
"X-APICloud-AppId" : appId,
"X-APICloud-AppKey" : appKey
//"authorization" : $api.getStorage('token')
},
data : {
body : bodyParam
}
}, function(ret, err) {
/*if (ret)
alert(JSON.stringify(ret));
else
alert(JSON.stringify(err));*/
callBack(ret, err);
});
}