<template>
  <view class="content"></view>
</template>

<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { useUserStore } from '@/store/modules/user'

const userStore = useUserStore()

onLoad(() => {
  checkLogin()
})

const checkLogin = () => {
  if (!userStore.isLogin) {
    uni.redirectTo({
      url: '/pages/login/index',
    })
  } else {
    uni.switchTab({
      url: '/pages/home/index',
    })
  }
}
</script>
