|
@@ -56,11 +56,11 @@ export default {
|
|
|
this.setUserShopAll()
|
|
this.setUserShopAll()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- this.init()
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 页面定义了 init 才调用,避免混入页无此方法时报错
|
|
|
|
|
+ typeof this.init === 'function' && this.init()
|
|
|
})
|
|
})
|
|
|
} else if (shareGuestRoute) {
|
|
} else if (shareGuestRoute) {
|
|
|
- this.init()
|
|
|
|
|
|
|
+ typeof this.init === 'function' && this.init()
|
|
|
}
|
|
}
|
|
|
}else{
|
|
}else{
|
|
|
hasTokenAutoLogin().then(subRes=>{
|
|
hasTokenAutoLogin().then(subRes=>{
|
|
@@ -77,7 +77,7 @@ export default {
|
|
|
that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
|
that.setUserShopAll()
|
|
that.setUserShopAll()
|
|
|
|
|
|
|
|
- that.init()
|
|
|
|
|
|
|
+ typeof that.init === 'function' && that.init()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -100,13 +100,13 @@ export default {
|
|
|
that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
|
|
|
that.setUserShopAll()
|
|
that.setUserShopAll()
|
|
|
that.$util.afterAppLoginSuccess({ auto: 1 })
|
|
that.$util.afterAppLoginSuccess({ auto: 1 })
|
|
|
- that.init()
|
|
|
|
|
|
|
+ typeof that.init === 'function' && that.init()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
// #endif
|
|
// #endif
|
|
|
}else{
|
|
}else{
|
|
|
- this.init()
|
|
|
|
|
|
|
+ typeof this.init === 'function' && this.init()
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|