mirror of
https://iceshrimp.dev/Crimekillz/jointrashposs.git
synced 2024-11-22 00:43:50 +01:00
(fix) 存在しないDocsにクライアント遷移した際にエラー画面が出るように
This commit is contained in:
parent
60dee6c133
commit
c471c53497
@ -69,7 +69,7 @@ const runtimeConfig = useRuntimeConfig();
|
||||
const { data } = await useAsyncData(`blog-${route.params.slug}`, () => queryContent<MiBlogParsedContent>(`/blog/${route.params.slug}`).findOne());
|
||||
|
||||
if (!data.value) {
|
||||
throw createError({ statusCode: 404, statusMessage: 'page not found' });
|
||||
throw createError({ statusCode: 404, statusMessage: 'page not found', fatal: true });
|
||||
}
|
||||
|
||||
const thumbnail = !data.value.thumbnail ? undefined : (parseURL(data.value.thumbnail).host == null) ? joinURL(runtimeConfig.public.baseUrl, data.value.thumbnail) : data.value.thumbnail;
|
||||
|
@ -66,7 +66,7 @@ const slugs = (route.params.slug as string[]).filter((v) => v !== '');
|
||||
const { data } = await useAsyncData(`docs-${locale.value}-${slugs.join('-')}`, () => queryContent<MiDocsParsedContent>(`/${locale.value}/docs/${slugs.join('/')}`).findOne());
|
||||
|
||||
if (!data.value) {
|
||||
throw createError({ statusCode: 404, statusMessage: 'page not found' });
|
||||
throw createError({ statusCode: 404, statusMessage: 'page not found', fatal: true });
|
||||
}
|
||||
|
||||
route.meta.title = data.value?.title;
|
||||
|
@ -39,7 +39,7 @@ const route = useRoute();
|
||||
const { data } = await useAsyncData('global-ns', () => queryContent(`/ns`).findOne());
|
||||
|
||||
if (!data.value) {
|
||||
throw createError({ statusCode: 404, statusMessage: 'page not found' });
|
||||
throw createError({ statusCode: 404, statusMessage: 'page not found', fatal: true });
|
||||
}
|
||||
|
||||
route.meta.title = data.value?.title;
|
||||
|
Loading…
Reference in New Issue
Block a user