Skip to content

Commit

Permalink
✨ useOrgsの使用
Browse files Browse the repository at this point in the history
  • Loading branch information
tomoyahiroe committed Mar 20, 2024
1 parent 071ab49 commit d7c7be2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
3 changes: 2 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<script setup lang="ts">
import AppSidebar from './AppSidebar.vue'
import AppSidebar from '~/layouts/AppSidebar.vue'
useHead({
title: 'Top',
titleTemplate: (title) => `${title} | YNU-fes`
})
const user = await useLogin().getCurrentUser()
</script>
<template>
<div id="dashboard-root-frame">
Expand Down
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default defineNuxtConfig({
baseURL: 'http://localhost:1306',
callbackURL: 'http://localhost:1306/api/v1/auth/line/callback',
lineClientID: process.env.LINE_CLIENT_ID,
enableRouting: false
enableRouting: true
}
}
})
39 changes: 24 additions & 15 deletions pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
<script lang="ts" setup>
import { onBeforeMount, ref } from 'vue'
import { useOrg, type AccessibleOrg } from '~/composables/useOrg'
useHead({ title: 'top' })
const showLogin = ref(false)
const showOrgs = ref(false)
onBeforeMount(() => {
console.log(document.cookie)
})
const accessibleOrgs: AccessibleOrg[] | null =
await useOrg().getAccessibleOrgs()
const orgInfo: OrgInfo | null =
accessibleOrgs != null
? await useOrg().getOrgInfo(accessibleOrgs[0].id)
: null
</script>
<template>
<main class="main-content-wrapper"></main>
<main class="main-content-wrapper">
<div v-if="!accessibleOrgs">
<p class="mx-auto w-fit mt-4 xl:ml-8">
アクセスできる企画団体が存在しません
</p>
</div>
<div v-else>
<pre class="util-color-bg-main w-fit p-5 mx-auto mt-4">{{
'アクセスできる企画団体一覧: ' +
JSON.stringify(accessibleOrgs, null, '\t')
}}</pre>
<pre class="util-color-bg-main w-fit p-5 mx-auto mt-4">{{
'デフォルトの企画団体情報: ' + JSON.stringify(orgInfo, null, '\t')
}}</pre>
</div>
</main>
</template>
<style>
.main-content-wrapper {
margin: 20px 40px;
}
.count-down {
margin: 40px 0;
}
</style>
<style></style>

0 comments on commit d7c7be2

Please sign in to comment.