mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
4.8.10 test (#2401)
* perf: i18n * perf: i18n and img tip * perf: readme * perf: hide tool ai response * fix: copy app * fix: parse image url regx * perf: folder collection forbid update
This commit is contained in:
@@ -118,7 +118,8 @@ export const loadRequestMessages = async ({
|
||||
}
|
||||
|
||||
// 正则表达式匹配图片URL
|
||||
const imageRegex = /(https?:\/\/.*\.(?:png|jpe?g|gif|webp|bmp|tiff?|svg|ico|heic|avif))/i;
|
||||
const imageRegex =
|
||||
/(https?:\/\/[^\s/$.?#].[^\s]*\.(?:png|jpe?g|gif|webp|bmp|tiff?|svg|ico|heic|avif))/i;
|
||||
|
||||
const result: { type: 'text' | 'image'; value: string }[] = [];
|
||||
let lastIndex = 0;
|
||||
|
@@ -110,10 +110,15 @@ export const dispatchHttp468Request = async (props: HttpRequestProps): Promise<H
|
||||
const requestBody = await (() => {
|
||||
if (!httpJsonBody) return {};
|
||||
try {
|
||||
// Replace all variables in the string body
|
||||
httpJsonBody = replaceVariable(httpJsonBody, allVariables);
|
||||
|
||||
// Text body, return directly
|
||||
if (headers['Content-Type']?.includes('text/plain')) {
|
||||
return httpJsonBody?.replaceAll(UNDEFINED_SIGN, 'null');
|
||||
}
|
||||
|
||||
// Json body, parse and return
|
||||
const jsonParse = JSON.parse(httpJsonBody);
|
||||
const removeSignJson = removeUndefinedSign(jsonParse);
|
||||
return removeSignJson;
|
||||
|
Reference in New Issue
Block a user