|
本帖最后由 北辰 于 2015-4-21 00:14 编辑
谢谢!
不好意思,是我的代码写错了,在调用ajaxRequest是我把bodyParam设成了空串,这个是不行的。把ajaxRequest重写,去掉bodyParam的部分就可以了。
===========================================
function ajaxRequestUserInfo(url, method, bodyParam, callBack) {
var common_url = 'https://d.apicloud.com/mcm/api';
var appId = 'A6973666436346';
var key = '64C65EDE-287E-1229-A9D2-D2FD8D38D9E4';
var now = Date.now();
var appKey = SHA1(appId + "UZ" + key + "UZ" + now) + "." + now;
//alert(common_url+url);
api.ajax({
url: common_url + url,
method: method,
cache: false,
timeout: 20,
headers: {
"X-APICloud-AppId": appId,
"X-APICloud-AppKey": appKey,
"authorization": $api.getStorage('token'),
"Content-type": "application/json"
},
//去掉下面3行就好了
//data: {
// body: bodyParam
//}
}, function (ret, err) {
callBack(ret, err);
});
}
===========================================
|
|