loading.vue 801 Bytes
<template>
</template>

<script type='text/ecmascript-6'>
export default {
  name: '',
  data () {
    return {
    }
  },
  mounted () {
    uni.showLoading()
    let userInfo = uni.$storage.get('userInfo')
    uni.$api.userApi.getListSelectAccount().then(res => {
      uni.hideLoading()
      setTimeout(() => {
        if (res.code == 0 && userInfo) {
          let url = {
            1: '/pages/boutique/index',
            0: '/pages/home/home'
          }[userInfo.sceneType]
          uni.reLaunch({
            url
          })
        }
        else uni.reLaunch({
          url: '/pages/common/login'
        })
      }, 500)
    }).catch(() => [
      uni.reLaunch({
        url: '/pages/common/login'
      })
    ])
  },
  methods: {
  }
}
</script>

<style scoped lang='scss'>
</style>