Commit 8a591c27 authored by liyang's avatar liyang

feat:调试数据入库

parent 415bee8a
......@@ -18,15 +18,17 @@ def getReptileTask():
# 将响应内容解析为 JSON 格式
return {"status_code": response.status_code, "data": response.json()}
def importJsonPath(form_data):
headers = {"Content-Type":"application/json"}
headers = {"Content-Type": "application/json"}
http_url = baser_url + "importJson/importJsonPath"
response = requests.post(http_url, headers=headers, data=form_data)
# 将响应内容解析为 JSON 格式
return {"status_code": response.status_code, "data": response.json()}
def runingPython(form_data):
headers = {"Content-Type":"application/json"}
headers = {"Content-Type": "application/json"}
http_url = baser_url + "python/startPy"
response = requests.post(http_url, headers=headers, data=form_data)
# 将响应内容解析为 JSON 格式
......
......@@ -157,10 +157,10 @@ def reptile(browser=None, search_word=""):
log.debug('文件保存成功')
# log.debug('文件绝对路径:'+os.path.abspath(file_dir))
form_data = {
path: os.path.abspath(file_dir) + ".json",
tableName: table_name
"path": os.path.abspath(file_dir) + ".json",
"tableName": table_name
}
response = importJsonPath()
response = importJsonPath(form_data)
else:
log.debug('文件保存失败')
# 关闭浏览器驱动
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment