Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
network-assets-reptile
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
network-assets-reptile
Commits
8a591c27
Commit
8a591c27
authored
Jul 10, 2023
by
liyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:调试数据入库
parent
415bee8a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
index.py
api/index.py
+4
-2
pc_ptt.py
pc_ptt.py
+3
-3
No files found.
api/index.py
View file @
8a591c27
...
@@ -18,15 +18,17 @@ def getReptileTask():
...
@@ -18,15 +18,17 @@ def getReptileTask():
# 将响应内容解析为 JSON 格式
# 将响应内容解析为 JSON 格式
return
{
"status_code"
:
response
.
status_code
,
"data"
:
response
.
json
()}
return
{
"status_code"
:
response
.
status_code
,
"data"
:
response
.
json
()}
def
importJsonPath
(
form_data
):
def
importJsonPath
(
form_data
):
headers
=
{
"Content-Type"
:
"application/json"
}
headers
=
{
"Content-Type"
:
"application/json"
}
http_url
=
baser_url
+
"importJson/importJsonPath"
http_url
=
baser_url
+
"importJson/importJsonPath"
response
=
requests
.
post
(
http_url
,
headers
=
headers
,
data
=
form_data
)
response
=
requests
.
post
(
http_url
,
headers
=
headers
,
data
=
form_data
)
# 将响应内容解析为 JSON 格式
# 将响应内容解析为 JSON 格式
return
{
"status_code"
:
response
.
status_code
,
"data"
:
response
.
json
()}
return
{
"status_code"
:
response
.
status_code
,
"data"
:
response
.
json
()}
def
runingPython
(
form_data
):
def
runingPython
(
form_data
):
headers
=
{
"Content-Type"
:
"application/json"
}
headers
=
{
"Content-Type"
:
"application/json"
}
http_url
=
baser_url
+
"python/startPy"
http_url
=
baser_url
+
"python/startPy"
response
=
requests
.
post
(
http_url
,
headers
=
headers
,
data
=
form_data
)
response
=
requests
.
post
(
http_url
,
headers
=
headers
,
data
=
form_data
)
# 将响应内容解析为 JSON 格式
# 将响应内容解析为 JSON 格式
...
...
pc_ptt.py
View file @
8a591c27
...
@@ -157,10 +157,10 @@ def reptile(browser=None, search_word=""):
...
@@ -157,10 +157,10 @@ def reptile(browser=None, search_word=""):
log
.
debug
(
'文件保存成功'
)
log
.
debug
(
'文件保存成功'
)
# log.debug('文件绝对路径:'+os.path.abspath(file_dir))
# log.debug('文件绝对路径:'+os.path.abspath(file_dir))
form_data
=
{
form_data
=
{
path
:
os
.
path
.
abspath
(
file_dir
)
+
".json"
,
"path"
:
os
.
path
.
abspath
(
file_dir
)
+
".json"
,
tableName
:
table_name
"tableName"
:
table_name
}
}
response
=
importJsonPath
()
response
=
importJsonPath
(
form_data
)
else
:
else
:
log
.
debug
(
'文件保存失败'
)
log
.
debug
(
'文件保存失败'
)
# 关闭浏览器驱动
# 关闭浏览器驱动
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment