Files
ZERO_CODE/ZeroCodeProject/main/client/node_modules/.cache/babel-loader/de8e8c343d4115d62d8badd44756f192f01cbba0a516d0481a176f01be3f8ef1.json

1 line
8.8 KiB
JSON
Raw Normal View History

2026-01-11 00:11:34 +08:00
{"ast":null,"code":"let axios_config = require(\"./config\");\nimport { ZeroCodeAxios } from \"@/request/request\";\nconst components = {};\nconst data = function () {\n return {\n scan_form: {\n ip: \"\",\n port: \"\"\n },\n tableData: [],\n columns: []\n };\n};\nfunction mounted() {}\nconst methods = {\n get_config_data(config_data) {\n console.log(config_data);\n // 执行转译data\n let new_data = {\n \"interaction_name\": config_data[\"interaction_name\"],\n \"return_data\": config_data[\"return_data\"],\n \"submit_data\": {\n \"interaction_source_name\": config_data[\"submit_data\"][\"interaction_source_name\"],\n \"interaction_source_uuid\": config_data[\"submit_data\"][\"interaction_source_uuid\"],\n \"interaction_object_type\": config_data[\"submit_data\"][\"interaction_object_type\"],\n \"interaction_style\": config_data[\"submit_data\"][\"interaction_style\"],\n \"target_table\": config_data[\"submit_data\"][\"target_table\"],\n \"target_api_url\": config_data[\"submit_data\"][\"target_api_url\"],\n \"target_api_ID\": config_data[\"submit_data\"][\"target_api_ID\"]\n }\n };\n let re = this.format_data(config_data[\"submit_data\"][\"data\"]);\n new_data[\"submit_data\"][\"data\"] = re;\n return new_data;\n },\n format_data(dict) {\n if (typeof dict == \"string\") {\n dict = eval(dict);\n } else {\n for (const key in dict) {\n let value = dict[key];\n if (typeof value == \"object\") {\n this.format_data(value);\n } else {\n if (typeof value == 'number') {\n dict[key] = value;\n } else {\n if (value.includes(\"this.\")) {\n if (dict.hasOwnProperty(key)) {\n dict[key] = eval(value);\n }\n } else {\n if (value.includes(\".\")) {\n if (dict.hasOwnProperty(key)) {\n dict[key] = eval(value);\n }\n } else {\n dict[key] = value;\n }\n }\n }\n }\n }\n }\n return dict;\n },\n submit_scan() {\n const {\n url,\n method,\n data: originalData,\n then\n } = axios_config.submit_scan.axios;\n const data = JSON.parse(JSON.stringify(originalData));\n let new_data = this.get_config_data(data);\n // 发起请求\n ZeroCodeAxios({\n method,\n url,\n data: new_data\n }).then(res => {\n // 执行回调函数then回调\n eval(then);\n });\n }\n};\nexport default {\n data: data,\n methods: methods,\n mounted: mounted,\n components: components\n};","map":{"version":3,"names":["axios_config","require","ZeroCodeAxios","components","data","scan_form","ip","port","tableData","columns","mounted","methods","get_config_data","config_data","console","log","new_data","re","format_data","dict","eval","key","value","includes","hasOwnProperty","submit_scan","url","method","originalData","then","axios","JSON","parse","stringify","res"],"sources":["/Users/xubincheng/Desktop/job/zero_code_all/zero_project/ZeroCodeProject/main/client/src/components/python_scan/python_scan.js"],"sourcesContent":["let axios_config = require(\"./config\")\nimport {ZeroCodeAxios} from \"@/request/request\"\n\nconst components = {}\n\nconst data = function () {\n return {\n scan_form: {\n ip: \"\",\n port: \"\"\n },\n tableData: [],\n columns: []\n }\n}\n\nfunction mounted() {\n\n}\n\nconst methods = {\n get_config_data(config_data) {\n console.log(config_data)\n // 执行转译data\n let new_data = {\n \"interaction_name\": config_data[\"interaction_name\"],\n \"return_data\": config_data[\"return_data\"],\n \"submit_data\": {\n \"interaction_source_name\": config_data[\"submit_data\"][\"interaction_source_name\"],\n \"interaction_source_uuid\": config_data[\"submit