🐛 Fix infinite redirect

This commit is contained in:
LittleSheep 2024-08-19 12:05:13 +08:00
parent b94e6906e1
commit d6936f0056
3 changed files with 5 additions and 4 deletions

View File

@ -7,8 +7,9 @@
<span>{{ post.author?.nick }} <span class="text-xs">@{{ post.author?.name }}</span></span> <span>{{ post.author?.nick }} <span class="text-xs">@{{ post.author?.name }}</span></span>
<span v-if="post.body?.title" class="text-md">{{ post.body?.title }}</span> <span v-if="post.body?.title" class="text-md">{{ post.body?.title }}</span>
<span v-if="post.body?.description" class="text-sm">{{ post.body?.description }}</span> <span v-if="post.body?.description" class="text-sm">{{ post.body?.description }}</span>
<span v-if="!post.body?.title && !post.body?.description" class="text-sm">{{ post.author?.description <span v-if="!post.body?.title && !post.body?.description" class="text-sm">
}}</span> {{ post.author?.description }}
</span>
</div> </div>
</div> </div>

View File

@ -103,7 +103,7 @@ if (!post.value) {
statusCode: 404, statusCode: 404,
statusMessage: "Post Not Found", statusMessage: "Post Not Found",
}) })
} else if (post.value.alias) { } else if (post.value.alias && !route.params.area) {
navigateTo(`/posts/${post.value.area_alias}/${post.value.alias}`) navigateTo(`/posts/${post.value.area_alias}/${post.value.alias}`)
} }

View File

@ -102,7 +102,7 @@ if (!post.value) {
statusCode: 404, statusCode: 404,
statusMessage: "Post Not Found", statusMessage: "Post Not Found",
}) })
} else if (post.value.alias) { } else if (post.value.alias && !route.params.area) {
navigateTo(`/posts/${post.value.area_alias}/${post.value.alias}`) navigateTo(`/posts/${post.value.area_alias}/${post.value.alias}`)
} }