Commit 8bad1ccb authored by liujiangnan's avatar liujiangnan

feat: 基础服务

parent 8fed7b7c
......@@ -133,22 +133,16 @@ export abstract class middleLayerBase extends cc.Component {
resolve(this.ENGINE_INFO);
return;
}
if ((<any>window).air.engineInfo) {
const engineInfo = JSON.parse((<any>window).air.engineInfo);
if (engineInfo.isDev == 1) {
engineInfo.domain = "http://staging-teach.cdn.ireadabc.com/";
engineInfo.apiBase = 'http://staging-openapi.iteachabc.com';
engineInfo.orgId = 521;
} else {
engineInfo.domain = "http://teach.cdn.ireadabc.com/";
engineInfo.apiBase = 'http://openapi.iteachabc.com';
engineInfo.orgId = 519;
const loopEngineInfo = () => {
this.scheduleOnce(() => {
if (!(<any>window).air.engineInfo) {
loopEngineInfo();
return;
}
this.ENGINE_INFO = engineInfo;
resolve(engineInfo);
if (this.ENGINE_INFO) {
resolve(this.ENGINE_INFO);
return;
}
(<any>window).courseware.getEngineInfo(() => {
const engineInfo = JSON.parse((<any>window).air.engineInfo);
if (engineInfo.isDev == 1) {
engineInfo.domain = "http://staging-teach.cdn.ireadabc.com/";
......@@ -161,7 +155,9 @@ export abstract class middleLayerBase extends cc.Component {
}
this.ENGINE_INFO = engineInfo;
resolve(engineInfo);
});
}, 0.05);
};
loopEngineInfo();
});
}
asyncCallNetworkApiGet(uri, data): Promise<any> {
......
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