Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxScanck
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
yaozheng
wxScanck
Commits
17d45453
Commit
17d45453
authored
Apr 15, 2022
by
TesterYao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
089697a4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
2 deletions
+45
-2
pangu.py
pangu.py
+42
-0
wx-starter.py
wx-starter.py
+3
-2
No files found.
pangu.py
0 → 100644
View file @
17d45453
from
time
import
sleep
import
requests
from
log
import
LOG
class
PG
:
def
__init__
(
self
):
self
.
host
=
'https://ssp-manager.tuia.cn'
# 盘古获取待巡查列表接口
self
.
valid_list_url
=
'/wchatDomain/wechatScan/openIdAddress?keyStr=wx.openid.redirect.host'
# 盘古上报被封域名列表,微信扫码巡查使用
self
.
block_list_url
=
'https://ssp-manager.tuia.cn/wchatDomain/wechatScan/sendDingDing'
self
.
session
=
requests
.
session
()
def
get_valid_list
(
self
):
LOG
.
info
(
'开始获取盘古巡查列表'
)
r
=
self
.
session
.
get
(
url
=
self
.
host
+
self
.
valid_list_url
)
if
r
.
status_code
==
200
and
r
.
json
()
.
get
(
'desc'
)
==
'成功'
:
valid_list
=
[
r
.
json
()
.
get
(
'data'
)]
if
valid_list
:
LOG
.
info
(
'获取盘古巡查列表结果:'
+
str
(
valid_list
))
return
valid_list
else
:
LOG
.
error
(
'获取盘古巡查列表异常,repose:'
+
r
.
text
)
def
post_block_list
(
self
,
b_url
):
LOG
.
info
(
'盘古上报被封域名:'
+
b_url
)
data
=
{
'domain'
:
b_url
,
'type'
:
'1'
}
r
=
self
.
session
.
post
(
url
=
self
.
block_list_url
,
json
=
data
)
print
(
r
.
text
)
if
r
.
status_code
==
200
and
r
.
json
()
.
get
(
'desc'
)
==
"成功"
:
LOG
.
info
(
'上报成功:'
+
r
.
text
)
else
:
LOG
.
error
(
'上报失败,1.5S后重新上报:'
+
r
.
text
)
wx-starter.py
View file @
17d45453
...
@@ -4,6 +4,7 @@ from poco.drivers.ios import iosPoco
...
@@ -4,6 +4,7 @@ from poco.drivers.ios import iosPoco
from
dingMessage
import
send_messages
from
dingMessage
import
send_messages
from
log
import
LOG
from
log
import
LOG
from
manager
import
Zk
from
manager
import
Zk
from
pangu
import
PG
from
ssp
import
SSP
from
ssp
import
SSP
...
@@ -83,7 +84,7 @@ def re_wx():
...
@@ -83,7 +84,7 @@ def re_wx():
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
ssp
=
SSP
()
ssp
=
SSP
()
# zk = Zk
()
pangu
=
PG
()
LOG
.
info
(
'开始连接设备'
)
LOG
.
info
(
'开始连接设备'
)
device
=
connect_device
(
'ios:///http://127.0.0.1:8100'
)
device
=
connect_device
(
'ios:///http://127.0.0.1:8100'
)
LOG
.
info
(
'连接成功'
)
LOG
.
info
(
'连接成功'
)
...
@@ -93,7 +94,7 @@ if __name__ == '__main__':
...
@@ -93,7 +94,7 @@ if __name__ == '__main__':
check_ex
()
check_ex
()
check_wx
()
check_wx
()
scan
()
scan
()
# runner(zk
)
runner
(
pangu
)
runner
(
ssp
)
runner
(
ssp
)
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
)
print
(
e
)
...
...
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