Add vue-router, login/setup flow and backend logging

Refactor frontend to route-based navigation with vue-router, add
system setup and login pages with API integration. Add structured
logging, access-log middleware and startup lifecycle to FastAPI
backend.
This commit is contained in:
2026-05-06 22:23:42 +08:00
parent 83d7da3d62
commit ae63766c91
35 changed files with 3762 additions and 404 deletions

View File

@@ -0,0 +1,46 @@
<template>
<LoginView
:company-name="companyProfile.name"
:submitting="loginSubmitting"
:error-message="loginError"
@login="submitLogin"
@recover-password="handleRecoverPassword"
@sso-login="handleSsoLogin"
/>
</template>
<script setup>
import { useRoute, useRouter } from 'vue-router'
import { useSystemState } from '../composables/useSystemState.js'
import LoginView from './LoginView.vue'
const route = useRoute()
const router = useRouter()
const {
companyProfile,
handleLogin,
handleRecoverPassword,
handleSsoLogin,
loginError,
loginSubmitting,
resolveEntryRoute
} = useSystemState()
async function submitLogin(credentials) {
const passed = await handleLogin(credentials)
if (!passed) {
return
}
const redirect = typeof route.query.redirect === 'string' ? route.query.redirect : ''
if (redirect.startsWith('/app/')) {
router.replace(redirect)
return
}
router.replace(resolveEntryRoute())
}
</script>