You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
634 B
34 lines
634 B
<script>
|
|
export default {
|
|
onLaunch: function () {
|
|
console.log('App Launch')
|
|
this.setToken()
|
|
},
|
|
onShow: function () {
|
|
console.log('App Show')
|
|
},
|
|
onHide: function () {
|
|
console.log('App Hide')
|
|
},
|
|
|
|
methods: {
|
|
setToken() {
|
|
if (this.$cache.get('token')) {
|
|
uni.switchTab({
|
|
url: `/pages/home/home`,
|
|
})
|
|
} else {
|
|
uni.reLaunch({
|
|
url: '/pages/index/index',
|
|
})
|
|
}
|
|
},
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
/*每个页面公共css */
|
|
@import '@/uni_modules/uview-ui/index.scss';
|
|
</style>
|