修复 baseUrl为空bug

This commit is contained in:
tangly
2022-11-05 15:22:40 +08:00
parent 03b0dfae7b
commit f0cb8fbc34

View File

@@ -71,7 +71,7 @@ async function getPageProperties(id, block, schema, authToken, tagOptions, siteI
properties.status = properties.status?.[0]
if (properties.type === 'Post') {
properties.slug = BLOG.POST_URL_PREFIX + '/' + (properties.slug ?? properties.id)
properties.slug = BLOG.POST_URL_PREFIX ? (BLOG.POST_URL_PREFIX + '/' + (properties.slug ?? properties.id)) : (properties.slug ?? properties.id)
} else {
properties.slug = (properties.slug ?? properties.id)
}