🐛 Bug fixes

This commit is contained in:
LittleSheep 2024-08-17 00:04:21 +08:00
parent 5f062ac2a1
commit 4a51a85d9c
2 changed files with 17 additions and 5 deletions

View File

@ -16,7 +16,7 @@ export default defineNuxtConfig({
"/api/sitemap/posts", "/api/sitemap/posts",
], ],
}, },
} },
}, },
i18n: { i18n: {
@ -71,6 +71,11 @@ export default defineNuxtConfig({
}, },
highlight: { highlight: {
theme: "github-dark", theme: "github-dark",
langs: ["json", "yaml", "toml", "java", "javascript", "astro", "css", "scss", "dart", "go", "typescript", "c", "csharp",
"cpp", "bat", "bash", "sh", "dockerfile", "dotenv", "erlang", "fsharp", "markdown", "log",
"lua", "objc", "swift", "regex", "ruby", "rust", "postcss", "blade", "asciidoc", "cmake", "cobol", "pascal",
"nginx", "angular-html", "angular-ts", "gdscript", "gdshader", "gdresource", "groovy", "gql", "python",
"crystal", "sql", "plsql", "kotlin", "html", "vue", "gleam", "julia", "lisp", "xml", "csv"],
}, },
locales: ["en", "zh-CN"], locales: ["en", "zh-CN"],
defaultLocale: "en", defaultLocale: "en",

View File

@ -6,8 +6,8 @@
<div class="my-5 flex flex-row gap-4"> <div class="my-5 flex flex-row gap-4">
<v-avatar :image="urlOfAvatar" /> <v-avatar :image="urlOfAvatar" />
<div class="flex flex-col"> <div class="flex flex-col">
<span>{{ account.nick }} <span class="text-xs">@{{ account.name }}</span></span> <span>{{ account?.nick }} <span class="text-xs">@{{ account?.name }}</span></span>
<span class="text-sm">{{ account.description }}</span> <span class="text-sm">{{ account?.description }}</span>
</div> </div>
</div> </div>
@ -45,8 +45,15 @@ const posts = ref<any[]>([])
const { data: account } = await useFetch<any>(`${config.public.solarNetworkApi}/cgi/auth/users/${route.params.name}`) const { data: account } = await useFetch<any>(`${config.public.solarNetworkApi}/cgi/auth/users/${route.params.name}`)
const urlOfAvatar = computed(() => account.value.avatar ? `${config.public.solarNetworkApi}/cgi/files/attachments/${account.value.avatar}` : void 0) if (account.value == null) {
const urlOfBanner = computed(() => account.value.banner ? `${config.public.solarNetworkApi}/cgi/files/attachments/${account.value.banner}` : void 0) throw createError({
statusCode: 404,
statusMessage: "User Not Found",
})
}
const urlOfAvatar = computed(() => account.value?.avatar ? `${config.public.solarNetworkApi}/cgi/files/attachments/${account.value.avatar}` : void 0)
const urlOfBanner = computed(() => account.value?.banner ? `${config.public.solarNetworkApi}/cgi/files/attachments/${account.value.banner}` : void 0)
const externalOpenLink = computed(() => `${config.public.solianUrl}/accounts/view/${route.params.name}`) const externalOpenLink = computed(() => `${config.public.solianUrl}/accounts/view/${route.params.name}`)