Commit 02e023e2 authored by 李维's avatar 李维

在心跳请求中,增加登录状态判断,实现单点登录

parent cb398c89
...@@ -81,6 +81,9 @@ export default class NewClass extends cc.Component { ...@@ -81,6 +81,9 @@ export default class NewClass extends cc.Component {
isAnonymous: false, isAnonymous: false,
isIOSReview: false, isIOSReview: false,
}) })
// 清空信息
cc.sys.localStorage.setItem('token', "");
cc.sys.localStorage.setItem('phone', "");
} }
return this.getStatus("userInfo") return this.getStatus("userInfo")
} }
...@@ -238,39 +241,33 @@ export default class NewClass extends cc.Component { ...@@ -238,39 +241,33 @@ export default class NewClass extends cc.Component {
.start(); .start();
}) })
} else { } else {
inPage.opacity = 0; if(outPage) {
outPage.opacity = 255; outPage.active = false;
} else {
// 未传移除页面 则全部移除
this.justShowView("")
}
inPage.active = true; inPage.active = true;
cc.tween(inPage) inPage.x = 0;
.to(0.1, { inPage.y = 0;
opacity: 255
})
.start();
return new Promise((resovle, reject)=>{ return new Promise((resovle, reject)=>{
cc.tween(outPage) setTimeout(()=>{
.to(0.1, { resovle(true)
opacity: 0 }, 1)
})
.call(() => {
outPage.active = false;
resovle(true)
})
.start();
}) })
} }
} }
justShowView(viewName){ justShowView(viewName) {
this.loginPage.active=viewName=="LoginPage" this.loginPage.active = viewName == "LoginPage"
this.homePage.active=viewName=="homePage" this.homePage.active = viewName == "homePage"
this.libraryPage.active=viewName=="libraryPage" this.libraryPage.active = viewName == "libraryPage"
this.libraryReadPage.active=viewName=="libraryReadPage" this.libraryReadPage.active = viewName == "libraryReadPage"
this.libraryAudioPage.active=viewName=="libraryAudioPage" this.libraryAudioPage.active = viewName == "libraryAudioPage"
this.libraryVideoPage.active=viewName=="libraryVideoPage" this.libraryVideoPage.active = viewName == "libraryVideoPage"
this.libraryReadDetailPage.active=viewName=="libraryReadDetailPage" this.libraryReadDetailPage.active = viewName == "libraryReadDetailPage"
this.unitPage.active=viewName=="unitPage" this.unitPage.active = viewName == "unitPage"
this.missionPage.active=viewName=="missionPage" this.missionPage.active = viewName == "missionPage"
} }
// update (dt) {} // update (dt) {}
} }
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