Commit 8bad1ccb authored by liujiangnan's avatar liujiangnan

feat: 基础服务

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