mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-04-21 03:17:28 +08:00
feat: add point mall module
This commit is contained in:
29
frontend_nuxt/pages/about/points.vue
Normal file
29
frontend_nuxt/pages/about/points.vue
Normal file
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<div class="point-mall-page">
|
||||
<p v-if="authState.loggedIn && point !== null">我的积分:{{ point }}</p>
|
||||
<p v-else>请先登录以查看积分</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { authState, fetchCurrentUser } from '~/utils/auth'
|
||||
|
||||
const point = ref(null)
|
||||
|
||||
onMounted(async () => {
|
||||
if (authState.loggedIn) {
|
||||
const user = await fetchCurrentUser()
|
||||
point.value = user ? user.point : null
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.point-mall-page {
|
||||
padding: 20px;
|
||||
max-width: var(--page-max-width);
|
||||
background-color: var(--background-color);
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user