<template>
  <view class="login-page">
    <UnauthLoginPanel @login="handleLogin" />
  </view>
</template>

<script setup>
import { useComprehensiveSessionStore } from '@/modules/comprehensive/stores/session'
import UnauthLoginPanel from '@/components/UnauthLoginPanel.vue'

const session = useComprehensiveSessionStore()

const handleLogin = async () => {
  try {
    await session.login()
    uni.redirectTo({ url: '/pages/comprehensive/profile/detail' })
  } catch {
    uni.showToast({ title: '登录失败，请重试', icon: 'none' })
  }
}
</script>

<style lang="scss" scoped>
.login-page {
  min-height: 100vh;
  background: $bg-color-soft;
}
</style>
