[PER-ZY001] 公告板模块代码审查修复 · rich_text安全检查 + 日志改进
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
15e42220e4
commit
63be5b9b8a
|
|
@ -105,6 +105,7 @@ function extractBlockText(block) {
|
||||||
const type = block.type;
|
const type = block.type;
|
||||||
if (!block[type]) return '';
|
if (!block[type]) return '';
|
||||||
const richTexts = block[type].rich_text || block[type].text || [];
|
const richTexts = block[type].rich_text || block[type].text || [];
|
||||||
|
if (!Array.isArray(richTexts)) return '';
|
||||||
return richTexts.map(t => t.plain_text || '').join('');
|
return richTexts.map(t => t.plain_text || '').join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -192,7 +193,7 @@ async function main() {
|
||||||
|
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
main().catch(e => {
|
main().catch(e => {
|
||||||
console.error('公告板模块执行失败:', e.message);
|
console.error('⚠️ 公告板模块执行失败(非阻断性):', e.message);
|
||||||
process.exit(0); // 不阻断天眼主流程
|
process.exit(0); // 不阻断天眼主流程
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue