From 670e73d8e568f2194b8b1ab324e9494dc5e5bc3f Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 16 Aug 2026 19:29:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=8F=9C=E5=8D=95=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8F=82=E6=95=B0=E4=B8=8D=E9=A2=84=E5=85=88?= =?UTF-8?q?=20urlencode=EF=BC=8C=E9=81=BF=E5=85=8D=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=8F=8C=E9=87=8D=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bricks_fetch 的 url_parse 会把 url 查询参数提取后 encodeURIComponent 再编码一次, dspy 里若已 urlencode 则 title(emoji/中文)被双重编码成 %F0%9F... 明文。 改为直接拼原始值,由前端统一编码一次。 --- wwwroot/api/agent_menus.dspy | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wwwroot/api/agent_menus.dspy b/wwwroot/api/agent_menus.dspy index 80d6bb8..c70c394 100644 --- a/wwwroot/api/agent_menus.dspy +++ b/wwwroot/api/agent_menus.dspy @@ -39,7 +39,9 @@ except Exception: menus = [] # 3. 构建菜单按钮(actiontype=urlwidget 打开通用弹窗 agent_menu_open,控制弹窗大小) -import urllib.parse as _urlparse +# 注意:这里不预先 urlencode 查询参数。前端 bricks_fetch 的 url_parse 会把 url 里的 +# 查询参数提取后再 encodeURIComponent 编码一次,若此处已 urlencode 会导致双重编码 +# (title 的 emoji/中文会变成 %F0%9F... 明文显示)。 buttons = [] @@ -60,8 +62,7 @@ for i, m in enumerate(menus): continue width = str(m.get("width", "85%") or "85%") height = str(m.get("height", "80%") or "80%") - query = _urlparse.urlencode({"url": url, "title": label, "width": width, "height": height}) - open_url = entire_url("/pipeline_core/api/agent_menu_open.dspy") + "?" + query + open_url = entire_url("/pipeline_core/api/agent_menu_open.dspy") + "?url=" + url + "&title=" + label + "&width=" + width + "&height=" + height buttons.append({ "widgettype": "Button", "options": {"label": label, "css": "small", "id": "menu_btn_%d" % i},