feat: separate Login and Register Page

This commit is contained in:
Lin, Hung-Shin committed 2023-10-13 16:13:25 +08:00
1 parent 7a9206fb47
commit 30aeacaf06
6 files changed
+159 -114

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
<script setup>
import AuthForm from '../components/AuthForm.vue'
import Background from '../components/DynamicBackground.vue'
import { login } from '../utils/auth'
const handleLogin = async ({ username, password, success, error }) => {
try {
const isSuccess = await login(username, password)
if (isSuccess) success()
else error('Wrong username or password.')
} catch (err) {
console.error(err)
}
}
</script>
<template>
<div class="relative w-screen h-screen">
<Background class="w-full h-full" />
<div
class="h-screen w-screen absolute top-0 left-0 flex flex-wrap justify-center content-center"
>
<div class="h-2/3 w-1/3">
<AuthForm @onSubmit="handleLogin" :isRegister="false" />
</div>
</div>
</div>
</template>