Skip to content

Commit

Permalink
feat(home): add home page
Browse files Browse the repository at this point in the history
  • Loading branch information
fu050409 committed May 21, 2024
1 parent 1586216 commit 00f953f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/views/index.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<script setup lang="ts">
import { onMounted } from 'vue';
import { onMounted, ref } from 'vue';
import { useAccountStore } from '../stores/account';
import router from '../routers';
import { useRouter } from 'vue-router';
import { useToast } from 'primevue/usetoast';
const toast = useToast();
const router = useRouter();
const accountStore = useAccountStore();
const msg = ref<string>('Please wait while we acquire your session...');
onMounted(async () => {
if (accountStore.isLoggedIn()) {
Expand All @@ -17,12 +19,17 @@ onMounted(async () => {
toast.add({ severity: 'error', summary: 'Error', detail: "Failed to acquire session: " + res.msg });
}
}
else
router.push('/login');
});
</script>

<template>
<div class="w-full h-full">
<Login></Login>
<div class="flex flex-col gap-3rem justify-center items-center h-screen">
<ProgressSpinner />
<span class="font-bold">{{ msg }}</span>
</div>
</div>
</template>

Expand Down
10 changes: 10 additions & 0 deletions src/views/login.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script setup lang="ts">
</script>

<template>
<div class="w-full h-full">
<LoginPanel></LoginPanel>
</div>
</template>

<style scoped></style>

0 comments on commit 00f953f

Please sign in to comment.