分页模式加载文章预览

This commit is contained in:
tangly1024
2022-01-07 17:49:51 +08:00
parent c89048178e
commit f84409e97f
21 changed files with 143 additions and 72 deletions

View File

@@ -26,7 +26,9 @@ export default {
POSTS: 'Posts',
VISITORS: 'Visitors',
VIEWS: 'Views',
COPYRIGHT_NOTICE: 'All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!'
COPYRIGHT_NOTICE: 'All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!',
RESULT_OF_SEARCH: 'Results Found',
ARTICLE_DETAIL: 'Article Details'
},
PAGINATION: {
PREV: 'Prev',

View File

@@ -28,7 +28,9 @@ export default {
POSTS: '篇文章',
VISITORS: '位访客',
VIEWS: '次查看',
COPYRIGHT_NOTICE: '本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。'
COPYRIGHT_NOTICE: '本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。',
RESULT_OF_SEARCH: '篇搜索到的结果',
ARTICLE_DETAIL: '文章详情'
},
PAGINATION: {
PREV: '上一页',

View File

@@ -20,6 +20,22 @@ export async function getPostBlocks (id, from) {
return null
}
// 去掉不用的字段
for (const j in pageBlock?.block) {
const b = pageBlock?.block[j]
if (b) {
delete b.role
delete b.value?.version
delete b.value?.created_time
delete b.value?.last_edited_time
delete b.value?.created_by_table
delete b.value?.created_by_id
delete b.value?.last_edited_by_table
delete b.value?.last_edited_by_id
delete b.value?.space_id
}
}
if (pageBlock) {
await setDataToCache(cacheKey, pageBlock)
}