From 02d200fe127f77fbf0622d4891786006b7b7a422 Mon Sep 17 00:00:00 2001 From: Blizzard Date: Sun, 11 Oct 2026 09:53:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E8=AE=B0=E5=88=97=E8=A1=A8=E8=B6=85?= =?UTF-8?q?=E8=BF=87100=E5=AD=97=E6=98=BE=E7=A4=BA=E7=9C=81=E7=95=A5?= =?UTF-8?q?=E5=8F=B7=E5=B9=B6=E4=BF=9D=E7=95=99=E5=AE=8C=E6=95=B4=E6=AD=A3?= =?UTF-8?q?=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- weapp/utils/journal.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weapp/utils/journal.js b/weapp/utils/journal.js index 8dc55e3..3938e4f 100644 --- a/weapp/utils/journal.js +++ b/weapp/utils/journal.js @@ -4,7 +4,9 @@ function diaryEntry(item) { if (typeof images === 'string') { try { images = JSON.parse(images); } catch (e) { images = []; } } if (!Array.isArray(images)) images = []; var date = String(item.created_at || '').slice(0, 10); - return Object.assign({}, item, { title: item.title || '日常的一页', summary: String(item.content || '').replace(/\s+/g, ' ').slice(0, 100), date: date, dateLabel: date.replace(/-/g, '.'), cover: getImageUrl(images[0]), imageCount: images.length, author: item.creator_name || item.created_by_name || '' }); + var characters = Array.from(String(item.content || '').replace(/\s+/g, ' ')); + var summary = characters.slice(0, 100).join('') + (characters.length > 100 ? '…' : ''); + return Object.assign({}, item, { title: item.title || '日常的一页', summary: summary, date: date, dateLabel: date.replace(/-/g, '.'), cover: getImageUrl(images[0]), imageCount: images.length, author: item.creator_name || item.created_by_name || '' }); } function albumEntry(item) { return Object.assign({}, item, { cover: getImageUrl(item.cover), title: item.title || '我们的相册' }); } function memoryEntry(item) {