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

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

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