// src/router/routes.ts
import type { RouteRecordRaw } from 'vue-router'

export const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: { title: '登录', requiresAuth: false, keepAlive: true },
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import('@/views/register/index.vue'),
    meta: { title: '注册', requiresAuth: false },
  },
  {
    path: '/agreement',
    name: 'Agreement',
    component: () => import('@/views/agreement/index.vue'),
    meta: { title: '协议', requiresAuth: false },
  },
  {
    path: '/invoice-information',
    name: 'InvoiceInformation',
    component: () => import('@/views/invoice-information/index.vue'),
    meta: { title: '自然人开票', requiresAuth: true },
  },
  {
    path: '/invoice-information/detail',
    name: 'InvoiceInformationDetail',
    component: () => import('@/views/invoice-information/detail.vue'),
    meta: { title: '应缴税信息', requiresAuth: true },
  },
  {
    path: '/identity-upload',
    name: 'UploadIdentityInformation',
    component: () => import('@/views/identity-upload/index.vue'),
    meta: { title: '开票认证', requiresAuth: true },
  },
  {
    path: '/face-recognition',
    name: 'FaceRecognition',
    component: () => import('@/views/face-recognition/index.vue'),
    meta: { title: '开票认证', requiresAuth: true },
  },
  {
    path: '/success',
    name: 'Success',
    component: () => import('@/views/success/index.vue'),
    meta: { title: '开票完成', requiresAuth: false },
  },
  {
    path: '/login-success',
    name: 'LoginSuccess',
    component: () => import('@/views/success/loginSuccess.vue'),
    meta: { title: '自然人开票', requiresAuth: false },
  },
  {
    path: '/pedding-face-recognition',
    name: 'PeddingFaceRecognition',
    component: () => import('@/views/pedding-face-recognition/index.vue'),
    meta: { title: '获取认证状态', requiresAuth: true },
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/login',
  },
]
