diff --git a/app/components/AppShell.vue b/app/components/AppShell.vue
index f593412..3c83137 100644
--- a/app/components/AppShell.vue
+++ b/app/components/AppShell.vue
@@ -10,7 +10,7 @@ withDefaults(
)
const route = useRoute()
-const { loggedIn, user, refresh, clear, pending } = useAuthSession()
+const { loggedIn, user, refresh, clear, initialized } = useAuthSession()
const { fetchData } = useClientApi()
const { allowRegister, siteName } = useGlobalConfig()
@@ -93,7 +93,7 @@ async function logout() {
try {
await fetchData<{ success: boolean }>('/api/auth/logout', { method: 'POST' })
clear()
- await navigateTo('/login')
+ await navigateTo('/')
} finally {
logoutLoading.value = false
}
@@ -158,7 +158,7 @@ async function logout() {
-
+
diff --git a/app/components/PostComments.vue b/app/components/PostComments.vue
index 55cf70c..621f40d 100644
--- a/app/components/PostComments.vue
+++ b/app/components/PostComments.vue
@@ -164,10 +164,10 @@ async function submitComment() {
评论
-
+
加载评论…
-
+
评论加载失败
diff --git a/app/layouts/public.vue b/app/layouts/public.vue
index 38dbb92..b068c25 100644
--- a/app/layouts/public.vue
+++ b/app/layouts/public.vue
@@ -7,7 +7,7 @@ import {
import { unwrapApiBody, type ApiResponse } from '../utils/http/factory'
const route = useRoute()
-const { loggedIn, pending, refresh } = useAuthSession()
+const { loggedIn, refresh, initialized } = useAuthSession()
const { siteName } = useGlobalConfig()
const showPublicLayoutToggle = computed(() => /^\/@[^/]+$/.test(route.path))
@@ -40,14 +40,25 @@ const { data: publicHomeHeader } = await useAsyncData(
const headerBrandTo = computed(() => (profileSlug.value ? `/@${profileSlug.value}` : '/'))
const headerBrandTitle = computed(() => {
- if (profileSlug.value && publicHomeHeader.value?.title) {
- return publicHomeHeader.value.title
+ if (!profileSlug.value) {
+ return siteName.value
+ }
+ const t = publicHomeHeader.value?.title
+ if (typeof t === 'string' && t.trim().length) {
+ return t.trim()
}
return siteName.value
})
-const headerBrandIconUrl = computed(() =>
- profileSlug.value ? publicHomeHeader.value?.iconUrl ?? null : null,
-)
+const headerBrandIconUrl = computed(() => {
+ if (!profileSlug.value) {
+ return null
+ }
+ const u = publicHomeHeader.value?.iconUrl
+ if (typeof u !== 'string' || !u.trim()) {
+ return null
+ }
+ return u.trim()
+})
type LayoutBySlug = Record
@@ -137,7 +148,7 @@ onMounted(() => {
阅读
-
+
({
-
+
加载中…
-
+
diff --git a/app/pages/@[publicSlug]/index.vue b/app/pages/@[publicSlug]/index.vue
index b54f219..7e6764a 100644
--- a/app/pages/@[publicSlug]/index.vue
+++ b/app/pages/@[publicSlug]/index.vue
@@ -148,10 +148,10 @@ const showBioReadMore = computed(() => {
-
+
加载中…
-
+
diff --git a/app/pages/@[publicSlug]/posts/[postSlug].vue b/app/pages/@[publicSlug]/posts/[postSlug].vue
index 5ba24eb..b4c6274 100644
--- a/app/pages/@[publicSlug]/posts/[postSlug].vue
+++ b/app/pages/@[publicSlug]/posts/[postSlug].vue
@@ -80,10 +80,10 @@ const editPostHref = computed(() =>
-
+
加载中…
-
+
diff --git a/app/pages/@[publicSlug]/posts/index.vue b/app/pages/@[publicSlug]/posts/index.vue
index c1affc4..3348049 100644
--- a/app/pages/@[publicSlug]/posts/index.vue
+++ b/app/pages/@[publicSlug]/posts/index.vue
@@ -77,11 +77,11 @@ const { data, pending, error } = await useAsyncData(
-
+
加载中…
-
+
加载中…
-
+
加载中…
('/api/auth/logout', { method: 'POST' })
clear()
- await navigateTo('/login')
+ await navigateTo('/')
} finally {
logoutLoading.value = false
}
diff --git a/app/pages/me/profile/index.vue b/app/pages/me/profile/index.vue
index e94cb27..e001ab4 100644
--- a/app/pages/me/profile/index.vue
+++ b/app/pages/me/profile/index.vue
@@ -243,14 +243,14 @@ async function save() {
-
+
diff --git a/app/pages/p/[publicSlug]/t/[shareToken].vue b/app/pages/p/[publicSlug]/t/[shareToken].vue
index 28f80b1..010b8b8 100644
--- a/app/pages/p/[publicSlug]/t/[shareToken].vue
+++ b/app/pages/p/[publicSlug]/t/[shareToken].vue
@@ -36,10 +36,10 @@ const renderedUnlistedPostBody = computed(() => {
-
+
加载中…
-
+
{{ data.kind }}
diff --git a/packages/drizzle-pkg/db.sqlite b/packages/drizzle-pkg/db.sqlite
index be9e14b..31ab19f 100644
Binary files a/packages/drizzle-pkg/db.sqlite and b/packages/drizzle-pkg/db.sqlite differ
diff --git a/server/api/public/profile/[publicSlug]/home-header.get.ts b/server/api/public/profile/[publicSlug]/home-header.get.ts
index a02e5fe..6d8ee14 100644
--- a/server/api/public/profile/[publicSlug]/home-header.get.ts
+++ b/server/api/public/profile/[publicSlug]/home-header.get.ts
@@ -27,11 +27,10 @@ export default defineEventHandler(async (event) => {
const configuredTitle = typeof titleCfg === "string" ? titleCfg.trim() : "";
const configuredIcon = typeof iconCfg === "string" ? iconCfg.trim() : "";
- const publicAvatar = owner.avatarVisibility === "public" ? owner.avatar : null;
- const nickname = owner.nickname?.trim() ?? "";
+ const site = typeof siteName === "string" ? siteName.trim() : "";
- const title = configuredTitle || nickname || siteName;
- const iconUrl = configuredIcon || publicAvatar || null;
+ const title = configuredTitle || site;
+ const iconUrl = configuredIcon.length > 0 ? configuredIcon : null;
return R.success({ title, iconUrl });
});