Commit 206fd7e4 by heheer Committed by GitHub

fix: question guide prompt save & sub route image (#5672)

* fix: question guide prompt save & sub route image

* fix markdown
parent 3099b333
......@@ -13,10 +13,13 @@ description: 'FastGPT V4.12.5 更新说明'
## 🐛 修复
1. debug 模式下,全局变量未传递。
2. debug 模式下,前方节点参数无法传递至后方节点
2. debug 模式下,前方节点参数无法传递至后方节点
3. 调试模式下,开启“自动执行”,会跳过外部变量的填写。
4. 自动语音回复未生效
5. 节点复制,报错捕获配置丢失
4. 自动语音回复未生效。
5. 节点复制,报错捕获配置丢失。
6. “猜你想问”的自定义提示词,保存时,上一次的值会被置空。
7. 配置了二级路由的情况下,知识库检索出来的图片地址拼接异常。
8. Prompt 编辑器,键盘输入时会清除掉 Markdown 标记。
## 🔨 插件更新
......
......@@ -39,6 +39,7 @@
"document/content/docs/introduction/development/proxy/http_proxy.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/development/proxy/nginx.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/development/sealos.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/development/signoz.mdx": "2025-09-17T22:29:56+08:00",
"document/content/docs/introduction/guide/DialogBoxes/htmlRendering.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/DialogBoxes/quoteList.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/admin/sso.mdx": "2025-09-08T20:07:04+08:00",
......@@ -63,7 +64,7 @@
"document/content/docs/introduction/guide/dashboard/workflow/http.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/dashboard/workflow/knowledge_base_search_merge.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/dashboard/workflow/laf.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/dashboard/workflow/loop.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/dashboard/workflow/loop.mdx": "2025-09-17T22:29:56+08:00",
"document/content/docs/introduction/guide/dashboard/workflow/question_classify.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/dashboard/workflow/reply.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/dashboard/workflow/sandbox.mdx": "2025-07-23T21:35:03+08:00",
......@@ -80,7 +81,7 @@
"document/content/docs/introduction/guide/knowledge_base/template.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/knowledge_base/third_dataset.mdx": "2025-07-24T13:00:27+08:00",
"document/content/docs/introduction/guide/knowledge_base/websync.mdx": "2025-08-05T23:20:39+08:00",
"document/content/docs/introduction/guide/knowledge_base/yuque_dataset.mdx": "2025-09-17T19:04:12+08:00",
"document/content/docs/introduction/guide/knowledge_base/yuque_dataset.mdx": "2025-09-17T22:29:56+08:00",
"document/content/docs/introduction/guide/plugins/bing_search_plugin.mdx": "2025-07-23T21:35:03+08:00",
"document/content/docs/introduction/guide/plugins/dev_system_tool.mdx": "2025-08-20T19:00:48+08:00",
"document/content/docs/introduction/guide/plugins/doc2x_plugin_guide.mdx": "2025-07-23T21:35:03+08:00",
......@@ -98,7 +99,7 @@
"document/content/docs/protocol/terms.en.mdx": "2025-08-03T22:37:45+08:00",
"document/content/docs/protocol/terms.mdx": "2025-08-03T22:37:45+08:00",
"document/content/docs/toc.en.mdx": "2025-08-04T13:42:36+08:00",
"document/content/docs/toc.mdx": "2025-09-17T18:33:31+08:00",
"document/content/docs/toc.mdx": "2025-09-17T22:29:56+08:00",
"document/content/docs/upgrading/4-10/4100.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-10/4101.mdx": "2025-09-08T20:07:20+08:00",
"document/content/docs/upgrading/4-11/4110.mdx": "2025-08-05T23:20:39+08:00",
......@@ -107,8 +108,8 @@
"document/content/docs/upgrading/4-12/4121.mdx": "2025-09-07T14:41:48+08:00",
"document/content/docs/upgrading/4-12/4122.mdx": "2025-09-07T14:41:48+08:00",
"document/content/docs/upgrading/4-12/4123.mdx": "2025-09-07T20:55:14+08:00",
"document/content/docs/upgrading/4-12/4124.mdx": "2025-09-17T18:36:54+08:00",
"document/content/docs/upgrading/4-12/4125.mdx": "2025-09-17T21:22:47+08:00",
"document/content/docs/upgrading/4-12/4124.mdx": "2025-09-17T22:29:56+08:00",
"document/content/docs/upgrading/4-12/4125.mdx": "2025-09-18T16:15:12+08:00",
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",
......
......@@ -35,10 +35,14 @@ export const getImageBase64 = async (url: string) => {
export const addEndpointToImageUrl = (text: string) => {
const baseURL = process.env.FE_DOMAIN;
const subRoute = process.env.NEXT_PUBLIC_BASE_URL || '';
if (!baseURL) return text;
// 匹配 /api/system/img/xxx.xx 的图片链接,并追加 baseURL
return text.replace(
/(?<!https?:\/\/[^\s]*)(?:\/api\/system\/img\/[^\s.]*\.[^\s]*)/g,
(match) => `${baseURL}${match}`
const regex = new RegExp(
`(?<!https?:\\/\\/[^\\s]*)(?:${subRoute}\\/api\\/system\\/img\\/[^\\s.]*\\.[^\\s]*)`,
'g'
);
// 匹配 ${subRoute}/api/system/img/xxx.xx 的图片链接,并追加 baseURL
return text.replace(regex, (match) => {
return `${baseURL}${match}`;
});
};
......@@ -126,6 +126,7 @@ const CustomPromptEditor = ({
border="none"
p={0}
mb={2}
rounded={'none'}
_focus={{
border: 'none',
boxShadow: 'none'
......@@ -142,7 +143,7 @@ const CustomPromptEditor = ({
<Button
fontWeight={'medium'}
onClick={() => {
onChange(value.replace(defaultValue, ''));
onChange(value.replace(defaultPrompt, ''));
onClose();
}}
w={20}
......
import {
CHECK_LIST,
ELEMENT_TRANSFORMERS,
TEXT_FORMAT_TRANSFORMERS,
type Transformer
} from '@lexical/markdown';
import { ORDERED_LIST, UNORDERED_LIST, type Transformer } from '@lexical/markdown';
export const RICH_PROMPT_TRANSFORMERS: Array<Transformer> = [
CHECK_LIST,
...ELEMENT_TRANSFORMERS,
...TEXT_FORMAT_TRANSFORMERS
];
export const RICH_PROMPT_TRANSFORMERS: Array<Transformer> = [ORDERED_LIST, UNORDERED_LIST];
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment