mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
4.8.9 test fix (#2330)
* perf: query extension prompt * perf: get preview histories * perf: i18n * fix: share page cannot feedback * fix: publish i18n
This commit is contained in:
@@ -94,7 +94,11 @@ export const sliceJsonStr = (str: string) => {
|
||||
|
||||
export const sliceStrStartEnd = (str: string, start: number, end: number) => {
|
||||
const overSize = str.length > start + end;
|
||||
|
||||
if (!overSize) return str;
|
||||
|
||||
const startContent = str.slice(0, start);
|
||||
const endContent = overSize ? str.slice(-end) : '';
|
||||
return startContent + (overSize ? ` ...... ` : '') + endContent;
|
||||
|
||||
return `${startContent}${overSize ? `\n\n...[hide ${str.length - start - end} chars]...\n\n` : ''}${endContent}`;
|
||||
};
|
||||
|
Reference in New Issue
Block a user