User profile page webpage

This commit is contained in:
2025-08-02 20:30:48 +08:00
parent a932108c87
commit be7d7536fc
13 changed files with 381 additions and 15 deletions

View File

@@ -0,0 +1,43 @@
<template>
<div>
<img :src="userBackground" class="object-cover w-full max-h-48" style="aspect-ratio: 16/7" />
<n-tabs
animated
justify-content="center"
type="line"
placement="top"
:value="route.name?.toString()"
@update:value="onSwitchTab"
>
<n-tab-pane name="dashboardCurrent" tab="Information">
<router-view />
</n-tab-pane>
<n-tab-pane name="dashboardSecurity" tab="Security">
<router-view />
</n-tab-pane>
</n-tabs>
</div>
</template>
<script setup lang="ts">
import { useUserStore } from '@/stores/user'
import { NTabs, NTabPane } from 'naive-ui'
import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
const route = useRoute()
const router = useRouter()
const userStore = useUserStore()
function onSwitchTab(name: string) {
router.push({ name })
}
const userBackground = computed(() => {
return userStore.user.profile.background
? `/cgi/drive/files/${userStore.user.profile.background.id}?original=true`
: undefined
})
</script>

View File

@@ -15,7 +15,7 @@
</n-dropdown>
</div>
</n-layout-header>
<n-layout-content embedded content-style="padding: 24px;">
<n-layout-content embedded>
<router-view />
</n-layout-content>
</n-layout>