feat: Add logo and enhance login functionality
- Introduce a new logo asset for branding. - Update LoginDialog.vue to include routing for successful login and registration. - Modify Navbar.vue to integrate LoginDialog and manage its visibility. - Revise Login.vue to update the logo and welcome title, along with routing enhancements post-login and registration.
This commit is contained in:
parent
be4ab13b32
commit
90c2b445bd
4 changed files with 26 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||
import { Button } from '@/components/ui/button'
|
||||
|
|
@ -18,6 +19,7 @@ interface Emits {
|
|||
(e: 'success'): void
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
defineProps<Props>()
|
||||
const emit = defineEmits<Emits>()
|
||||
|
||||
|
|
@ -64,6 +66,8 @@ async function handleLogin() {
|
|||
toast.success('Login successful!')
|
||||
emit('success')
|
||||
handleClose()
|
||||
// Redirect to home page after successful login
|
||||
router.push('/')
|
||||
} catch (err) {
|
||||
error.value = err instanceof Error ? err.message : 'Login failed'
|
||||
toast.error('Login failed. Please check your credentials.')
|
||||
|
|
@ -89,6 +93,8 @@ async function handleRegister() {
|
|||
toast.success('Registration successful!')
|
||||
emit('success')
|
||||
handleClose()
|
||||
// Redirect to home page after successful registration
|
||||
router.push('/')
|
||||
} catch (err) {
|
||||
error.value = err instanceof Error ? err.message : 'Registration failed'
|
||||
toast.error('Registration failed. Please try again.')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue