Commit 46bd5bdb authored by liujiangnan's avatar liujiangnan

feat: 退出APP

parent 704967c2
......@@ -23,7 +23,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc.find(`Canvas/bg_ground/bg_grass_lite`).active = true;
if (this.engineType == 'aixuebao') {
cc.find(`Canvas/userInfo/frame/BtnLogout`).active = false;
cc.find(`Canvas/userInfo/frame/BtnLogout/text`).getComponent(cc.Label).string = "退出APP";
}
}
await this.initData();
......@@ -220,8 +220,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
const BtnLogout = cc.find('Canvas/userInfo/frame/BtnLogout');
buttonOnClick(BtnLogout, () => {
middleLayerComponent.showConfirm("确定退出?", () => {
if (this.engineType == 'aixuebao') {
if (window && (<any>window).courseware && (<any>window).courseware.exitApp) {
(<any>window).courseware.exitApp();
}
} else {
cc.sys.localStorage.setItem('token', '');
jumpToBundle('NJ_login');
}
});
});
......
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