mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-15 23:55:36 +00:00
fix: replace img host (#3691)
This commit is contained in:
@@ -92,7 +92,10 @@ export const loadRequestMessages = async ({
|
|||||||
const baseURL = process.env.FE_DOMAIN;
|
const baseURL = process.env.FE_DOMAIN;
|
||||||
if (!baseURL) return text;
|
if (!baseURL) return text;
|
||||||
// 匹配 /api/system/img/xxx.xx 的图片链接,并追加 baseURL
|
// 匹配 /api/system/img/xxx.xx 的图片链接,并追加 baseURL
|
||||||
return text.replace(/(\/api\/system\/img\/[^\s.]*\.[^\s]*)/g, (match, p1) => `${baseURL}${p1}`);
|
return text.replace(
|
||||||
|
/(?<!https?:\/\/[^\s]*)(?:\/api\/system\/img\/[^\s.]*\.[^\s]*)/g,
|
||||||
|
(match) => `${baseURL}${match}`
|
||||||
|
);
|
||||||
};
|
};
|
||||||
const parseSystemMessage = (
|
const parseSystemMessage = (
|
||||||
content: string | ChatCompletionContentPartText[]
|
content: string | ChatCompletionContentPartText[]
|
||||||
|
Reference in New Issue
Block a user