(content: string, maxLen = 30)
| 415 | |
| 416 | // 截取消息内容作为预览 |
| 417 | const getContentPreview = (content: string, maxLen = 30): string => { |
| 418 | const text = content.replace(/\n/g, ' ').trim() |
| 419 | return text.length > maxLen ? text.slice(0, maxLen) + '...' : text |
| 420 | } |
| 421 | |
| 422 | // 遍历当前路径 |
| 423 | for (const msg of currentPath) { |