fix/slug-undefined-html

This commit is contained in:
tangly1024
2023-07-07 21:10:37 +08:00
parent 45b0e2672d
commit dd6dc5a93a
3 changed files with 8 additions and 8 deletions

View File

@@ -76,12 +76,6 @@ export default async function getPageProperties(id, block, schema, authToken, ta
// 映射值用户个性化type和status字段的下拉框选项在此映射回代码的英文标识
mapProperties(properties)
// 开启伪静态路径
if (BLOG.PSEUDO_STATIC) {
if (!properties?.slug?.endsWith('.html') && !properties?.slug?.startsWith('http')) {
properties.slug += '.html'
}
}
properties.publishDate = new Date(properties?.date?.start_date || value.created_time).getTime()
properties.publishTime = formatDate(properties.publishDate, BLOG.LANG)
properties.lastEditedTime = formatDate(new Date(value?.last_edited_time), BLOG.LANG)
@@ -107,6 +101,12 @@ export default async function getPageProperties(id, block, schema, authToken, ta
}
properties.password = properties.password ? md5(properties.slug + properties.password) : ''
// 开启伪静态路径
if (JSON.parse(BLOG.PSEUDO_STATIC)) {
if (!properties?.slug?.endsWith('.html') && !properties?.slug?.startsWith('http')) {
properties.slug += '.html'
}
}
return properties
}