<script> export default { onLaunch: function () { console.log('App Launch') this.isLogin() }, onShow: function () { console.log('App Show') }, onHide: function () { console.log('App Hide') }, methods:{ // 是否登录 isLogin() { if(!this.$store.getters.getUserInfo.USER_ID) { uni.redirectTo({ url: '/pages/login/login' }) } } } } </script> <style lang="scss"> /*每个页面公共css */ @import "uview-ui/index.scss"; @import './styles/theme.scss'; @import './styles/uview.scss'; @import './styles/home_style.scss'; </style>