Commit 33ac7471 authored by limingzhe's avatar limingzhe

fix: debug

parent b1e619b5
......@@ -577,16 +577,22 @@ export abstract class middleLayerBase extends cc.Component {
const xhr = new XMLHttpRequest();
// const url = `${engineInfo["apiBase"]}${uri}`;
const url = `${this.API_BASE}${uri}`;
console.log('url : ' + url);
xhr.open("POST", url, true);
xhr.setRequestHeader('content-type', 'application/json');
xhr.onreadystatechange = () => {
if (xhr.readyState == 4) {
console.log('xhr.responseText : ' + xhr.responseText);
callBack(JSON.parse(xhr.responseText));
}
}
xhr.setRequestHeader("token", token)
xhr.send(JSON.stringify(data));
console.log('JSON.stringify(data) : ' + JSON.stringify(data));
// });
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment