|
|
@@ -202,6 +202,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
showTabTransition: true,
|
|
|
+ isLoggedIn: false,
|
|
|
role: 'parent',
|
|
|
isSwitchedChild: false,
|
|
|
nickname: '',
|
|
|
@@ -234,9 +235,6 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- isLoggedIn() {
|
|
|
- return !!uni.getStorageSync('token')
|
|
|
- },
|
|
|
activeChildId() {
|
|
|
if (this.role === 'child') {
|
|
|
return uni.getStorageSync('currentChildId')
|
|
|
@@ -247,10 +245,13 @@ export default {
|
|
|
onShow() {
|
|
|
this.showTabTransition = true
|
|
|
|
|
|
- if (!uni.getStorageSync('token')) {
|
|
|
+ var token = uni.getStorageSync('token')
|
|
|
+ if (!token) {
|
|
|
+ this.isLoggedIn = false
|
|
|
this._watchPageReady()
|
|
|
return
|
|
|
}
|
|
|
+ this.isLoggedIn = true
|
|
|
|
|
|
var currentRole = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || 'parent'
|
|
|
if (currentRole === 'teacher') {
|