<script>

export default {
  globalData: {
    isLogin: false
  },
  async onLaunch(options) {
    console.log('App Launch')
    const path = options.path ? '/' + options.path : '/pages/index/index'
    if (this.$api.user.isLogin()) {
      await this.$api.user.info().then(res => {
        this.$store.dispatch('user/info', res.data)
      })
    } else {
      uni.reLaunch({
        url: '/pages/login?path=' + path
      })
    }
  },
  onShow() {
    console.log('App Show')
  },
  onHide() {
    console.log('App Hide')
  }
}
</script>

<style lang="scss">
	/*每个页面公共css */
  @import "@/uni_modules/uview-ui/index.scss";
  @import '@/static/css/flex.scss';
  @import '@/static/css/common.scss';
  @import '@/static/css/iconfont.css';
</style>
