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},