Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

fix: 修复头像配置 `NUXT_PUBLIC_APP_AVATAR_URL` 没有正确应用(#8)

Timothy Yina345970d54bf
diff --git a/app/components/loader/Avatar.vue b/app/components/loader/Avatar.vue
index 50ac496e..d2aed224 100644
--- a/app/components/loader/Avatar.vue
+++ b/app/components/loader/Avatar.vue
@@ -1,4 +1,6 @@
-<script lang="ts" setup></script>
+<script lang="ts" setup>
+const config = useRuntimeConfig()
+</script>
<template>
<div class="relative size-20">
@@ -8,6 +10,13 @@
<div class="absolute inset-1 rounded-full overflow-hidden">
<img
+ v-if="config.public.APP_AVATAR_URL"
+ class="w-full h-full object-cover"
+ :src="config.public.APP_AVATAR_URL"
+ alt="Loading..."
+ />
+ <img
+ v-else
class="w-full h-full object-cover"
src="~/assets/images/avatar.webp"
alt="Loading..."
diff --git a/app/components/masonry/HeaderItem.vue b/app/components/masonry/HeaderItem.vue
index c7305840..83d2ecfb 100644
--- a/app/components/masonry/HeaderItem.vue
+++ b/app/components/masonry/HeaderItem.vue
@@ -75,7 +75,7 @@ const totalSelectedFilters = computed(() => {
<Icon name="tabler:star-filled" />
</div>
<img
- :src="avatarImage"
+ :src="config.public.APP_AVATAR_URL || avatarImage"
class="size-12 rounded-full object-cover"
:class="!loggedIn && 'cursor-pointer'"
alt="Author's avatar"
diff --git a/nuxt.config.ts b/nuxt.config.ts
index 6a0cc239..6d1dcd6f 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -3,7 +3,7 @@ import tailwindcss from '@tailwindcss/vite'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-07-15',
- devtools: { enabled: true },
+ devtools: { enabled: false },
modules: [
'reka-ui/nuxt',