Commit 234940ff authored by liujiangnan's avatar liujiangnan

feat: 爱学宝免登陆

parent 982e2a0f
......@@ -95,6 +95,8 @@ export default class NewClass extends middleLayerBase {
version = null;
isDev = null;
type = null;
engine_uuid = null;
async checkVersion() {
const { versionName: onlineVersion, storeList } = await this.getOnlineVersion();
const nativeVersion = await this.getNativeVersion();
......@@ -108,9 +110,11 @@ export default class NewClass extends middleLayerBase {
}
async getNativeVersion() {
const engineInfo = await this.getEngineInfo();
const { version, isDev } = JSON.parse(engineInfo);
const { version, isDev, type, uuid } = JSON.parse(engineInfo);
this.version = version;
this.isDev = isDev;
this.type = type;
this.engine_uuid = uuid;
return this.version;
}
......@@ -538,6 +542,15 @@ export default class NewClass extends middleLayerBase {
cc.find('middleLayer/BtnLeft').active = false;
cc.find('middleLayer/ExitBtn').active = false;
if (this.type == "AXB") {
// 机器码授权免登陆 (爱学宝)
const {token} = await this.asyncCallNetworkApiPost(`/api/oxfordlite/v1/engine/login`, {
engine_uuid: this.engine_uuid
});
cc.sys.localStorage.setItem('token', token);
}
const token = cc.sys.localStorage.getItem('token');
const kidDataStr = await this.asyncCallNetworkApiGet('/api/oxford/v1/kid/info', {
token: token
......
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