Add SPA to the Drive project for further usage

This commit is contained in:
2025-07-25 22:47:23 +08:00
parent d13fb8b0e4
commit 123dce564c
41 changed files with 2311 additions and 8 deletions

View File

@@ -1,8 +1,8 @@
<template>
<div class="max-w-3xl mx-auto p-8">
<div class="flex items-center gap-6 mb-8">
<n-avatar round :size="100" :alt="userStore.user.name">
<n-icon size="48">
<n-avatar round :size="100" :alt="userStore.user.name" :src="userPicture">
<n-icon size="48" v-if="!userPicture">
<person-round />
</n-icon>
</n-avatar>
@@ -50,6 +50,13 @@
import { NAvatar, NText, NProgress, NH3, NP, NButton, NIcon } from 'naive-ui'
import { PersonRound, LaunchOutlined } from '@vicons/material'
import { useUserStore } from '@/stores/user'
import { computed } from 'vue'
const userStore = useUserStore()
const userPicture = computed(() => {
return userStore.user.profile.picture
? `/cgi/drive/files/${userStore.user.profile.picture.id}`
: undefined
})
</script>

View File

@@ -29,9 +29,13 @@ export default defineConfig({
server: {
proxy: {
'/api': {
target: 'http://localhost:5216',
target: 'http://localhost:5090',
changeOrigin: true,
},
'/cgi': {
target: 'http://localhost:5090',
changeOrigin: true,
}
},
},
})