diff --git a/ApiAutomationTest/app/static/js/tool/http_cookie_manager.js b/ApiAutomationTest/app/static/js/tool/http_cookie_manager.js index 84753ca..0d4b774 100644 --- a/ApiAutomationTest/app/static/js/tool/http_cookie_manager.js +++ b/ApiAutomationTest/app/static/js/tool/http_cookie_manager.js @@ -99,9 +99,25 @@ function getHTTPCookieManagerToolElement(tool_id) { language: 'zh-CN', // 是否允许无效数据 默认 true allowInvalid: false, + afterPaste: afterPasteHookForTableParam, }; let $container = $(`#table-http-cookie-manager-${tool_id}`); element.obj.table_http_cookie_manager = $container.handsontable(option_table_http_cookie_manager).handsontable('getInstance'); + + // 解决复制粘贴后checkBox中的值由布尔类型变为字符串的问题 + function afterPasteHookForTableParam() { + let data = element.obj.table_http_cookie_manager.getSourceData(); + for (let i = 0; i < data.length; ++i) { + let row = data[i]; + if (row.secure === 'false'){ + row.secure = false; + } + if (row.secure === 'true'){ + row.secure = true; + } + } + element.obj.table_http_cookie_manager.loadData(data); + } } function saveTool() {