Commit 9b2cbfec authored by limingzhe's avatar limingzhe

fix: debug

parent a9341fa8
......@@ -21,8 +21,7 @@ export default class NewClass extends middleLayerBase {
this.reWriteAir();
this.role = 'student';
(<any>window).courseware.getEngineInfo();
// (<any>window).courseware.getEngineInfo();
}
async start() {
......
......@@ -534,9 +534,10 @@ export abstract class middleLayerBase extends cc.Component {
callNetworkApiPostNew(uri, data, callBack) {
const token = cc.sys.localStorage.getItem('student_token');
data = {...data, token};
this.getEngineInfo().then((engineInfo) => {
// this.getEngineInfo().then((engineInfo) => {
const xhr = new XMLHttpRequest();
const url = `${engineInfo["apiBase"]}${uri}`;
// const url = `${engineInfo["apiBase"]}${uri}`;
const url = `${this.API_BASE}${uri}`;
xhr.open("POST", url, true);
xhr.setRequestHeader('content-type', 'application/json');
xhr.onreadystatechange = () => {
......@@ -547,12 +548,12 @@ export abstract class middleLayerBase extends cc.Component {
xhr.setRequestHeader("token", token)
xhr.send(JSON.stringify(data));
});
// });
}
async callNetworkApiGetNew(uri, data, callBack) {
const token = cc.sys.localStorage.getItem('student_token');
const engineInfo = await this.getEngineInfo();
// const engineInfo = await this.getEngineInfo();
data = {...data};
let queryStr = '?';
const params = [];
......@@ -566,7 +567,8 @@ export abstract class middleLayerBase extends cc.Component {
} else {
queryStr = '';
}
const url = `${engineInfo["apiBase"]}${uri}${queryStr}`;
// const url = `${engineInfo["apiBase"]}${uri}${queryStr}`;
const url = `${this.API_BASE}${uri}${queryStr}`;
console.log("callNetworkApiGetNew url = " + url);
// 如果请求失败 最多尝试5次重连
......
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