This commit is contained in:
2025-06-21 19:31:51 +08:00
parent 32b6e04d6c
commit 29725a8614
2 changed files with 3 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ import { Mention } from '@kevisual/xhs/libs/xhs-type/mention.ts';
const sleep = (ms: number) => {
return new Promise((resolve) => setTimeout(resolve, ms));
};
export const splitContent = (content: string, maxLength: number = 300) => {
export const splitContent = (content: string, maxLength: number = 270) => {
const parts: string[] = [];
for (let i = 0; i < content.length; i += maxLength) {
parts.push(content.slice(i, i + maxLength));
@@ -83,7 +83,7 @@ app
.define(async (ctx) => {
const { note_id, comment_id, content } = ctx.query;
const client = xhsServices.getClient();
// content 300个字内超过cai fen
// content 小红书最大 300个字内超过则分割, 分比300小比如270
const textArr: string[] = splitContent(content);
const resArr: any[] = [];
for (let text of textArr) {