<script setup>
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { useUserStore } from '@/store/user'

// 在 setup 中获取 store
const userStore = useUserStore()

onLaunch(() => {
  console.log('App Launch')
  
  // 应用启动时尝试静默登录
  setTimeout(() => {
    userStore.getTokenSafe().then(token => {
      console.log('静默登录成功', token)
    }).catch(err => {
      console.log('静默登录失败，等待手动登录', err)
    })
  }, 0)
})
</script>


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