From 204f31b8ebdd297a438b42146adce106d7891874 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Mon, 7 Feb 2022 17:33:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E4=BB=A3=E7=A0=81=E7=89=87=E6=AE=B5?= =?UTF-8?q?=E6=89=A7=E8=A1=8Cpython=E6=8E=A5=E5=8F=A3=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010144 --user=lyh 【项目管理】自定义代码片段执行python接口请求脚本失败 https://www.tapd.cn/55049933/s/1101578 --- .../components/project/menu/function/custom-function.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/business/components/project/menu/function/custom-function.js b/frontend/src/business/components/project/menu/function/custom-function.js index 9902b240fa..b611362012 100644 --- a/frontend/src/business/components/project/menu/function/custom-function.js +++ b/frontend/src/business/components/project/menu/function/custom-function.js @@ -45,7 +45,7 @@ function pythonCode(requestObj) { connType = "HTTPSConnection"; } let headers = getHeaders(requestHeaders); - requestBody = requestBody ? requestBody : "{}"; + requestBody = requestBody ? JSON.stringify(requestBody) : "{}"; requestPath = getRequestPath(requestArguments, requestPath); let obj = {requestBody, headers, host, requestPath, requestMethod, connType}; return _pythonCodeTemplate(obj);