Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
AppMonitorSubscriber
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nongyingchen
AppMonitorSubscriber
Commits
fba09362
Commit
fba09362
authored
May 21, 2019
by
trace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加越南/菲律宾贷超数据
parent
0a4e5af8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
33 deletions
+46
-33
play.js
+46
-33
No files found.
play.js
View file @
fba09362
...
...
@@ -10,7 +10,12 @@ log(`当前奔跑在:${username}`)
let
ding
=
'https://oapi.dingtalk.com/robot/send?access_token='
let
debugDingding
=
`
${
ding
}
bf03c69128b771107b8715911b8a76db61a55cbd8b00e1a2c955578c2a3da719`
let
notifyDingding
=
`
${
ding
}
61403ec65efd7a9e40cb6d490e1bfab8aff28800696918a23ec4dffdf5aa1315`
let
daichao
=
`http://admin.uuang.co.id/admin/loan/listactive?current=0&size=10000&descs%5B0%5D=priority&packageId=10002`
let
daichao
=
`admin/loan/listactive?current=0&size=10000&descs%5B0%5D=priority&packageId=10002`
let
daichaoRegion
=
[
'http://admin.uuang.co.id/'
,
'http://admin.ph.g-cashing.com/'
,
'http://admin.a.vaylaco.com/'
]
// Config ------------------------------------------------------------
let
sec
=
1000
;
...
...
@@ -211,37 +216,45 @@ function generateDailyOnlineReport() {
}
async
function
getDaichao
()
{
await
getPromiss
(
daichao
)
.
then
(
val
=>
{
try
{
daichaoData
=
JSON
.
parse
(
val
&&
val
.
body
&&
val
.
body
||
"{}"
).
data
}
catch
(
err
)
{
errMsg
=
`贷超数据解析出错:
${
err
}
`
errorLog
.
push
(
errMsg
)
return
}
daichaoApps
=
daichaoData
&&
daichaoData
.
map
(
app
=>
app
.
packageName
)
||
[]
for
(
index
in
(
daichaoData
&&
daichaoData
||
[]))
{
let
app
=
daichaoData
[
index
]
daichaoAppInfoes
[
app
.
packageName
]
=
{
name
:
app
.
name
,
daichaoId
:
app
.
id
for
(
index
in
daichaoRegion
)
{
let
region
=
daichaoRegion
[
index
]
daichaoApiUrl
=
region
+
daichao
log
(
` 贷超 url:
${
daichaoApiUrl
}
`
)
await
getPromiss
(
daichaoApiUrl
)
.
then
(
val
=>
{
try
{
daichaoData
=
JSON
.
parse
(
val
&&
val
.
body
&&
val
.
body
||
"{}"
).
data
}
catch
(
err
)
{
errMsg
=
`贷超数据解析出错:
${
err
}
`
errorLog
.
push
(
errMsg
)
return
}
}
if
(
isTest
())
{
daichaoApps
=
daichaoApps
.
slice
(
0
,
1
)
}
log
(
`代超数据:
${
daichaoApps
.
length
}
个`
)
monitorNames
[
"daichao"
]
=
daichaoApps
if
(
daichaoApps
.
length
==
0
)
{
log
(
'代超数据为空'
)
}
})
.
catch
(
err
=>
{
errorLog
.
push
(
`贷超获取失败:
${
err
.
toString
()}
`
)
return
})
log
(
`
${
region
}
贷超获取到
${
daichaoData
.
length
}
个数据`
)
thisDaichaoApps
=
daichaoData
&&
daichaoData
.
map
(
app
=>
app
.
packageName
)
||
[]
for
(
index
in
(
daichaoData
&&
daichaoData
||
[]))
{
let
app
=
daichaoData
[
index
]
daichaoAppInfoes
[
app
.
packageName
]
=
{
name
:
app
.
name
,
daichaoId
:
app
.
id
,
mgt
:
`
${
region
}
#/loan/`
}
}
if
(
isTest
())
{
thisDaichaoApps
=
thisDaichaoApps
.
slice
(
0
,
1
)
}
log
(
`
${
region
}
代超数据:
${
thisDaichaoApps
.
length
}
个`
)
daichaoApps
=
[...
daichaoApps
,
...
thisDaichaoApps
]
monitorNames
[
"daichao"
]
=
daichaoApps
if
(
daichaoApps
.
length
==
0
)
{
log
(
`目前总共贷超数据为空`
)
}
log
(
`目前总共贷超数据:
${
daichaoApps
.
length
}
`
)
})
.
catch
(
err
=>
{
errorLog
.
push
(
`贷超获取失败:
${
err
.
toString
()}
`
)
return
})
}
}
// async function getDaichao(url) {
...
...
@@ -514,7 +527,7 @@ function genMail() {
let
lastLoopDate
=
status
[
'lastLoopDate'
]
&&
new
Date
(
status
[
'lastLoopDate'
])
||
new
Date
()
let
loopInterval
=
(
new
Date
()).
getHours
()
-
lastLoopDate
.
getHours
()
let
lastGenerate
=
`<br/><br/><br/>上次循环时间
${
lastLoopDate
.
toLocaleString
()}
, 间隔:
${
loopInterval
}
小时`
status
[
'lastLoopDate'
]
=
Date
()
if
(
!
isFirstRun
&&
!
needSendList
&&
newOffline
.
length
==
0
...
...
@@ -664,7 +677,7 @@ function genMail() {
function
isOurs
(
name
,
countOurs
)
{
if
(
daichaoApps
.
includes
(
name
))
{
return
`<a href="
http://admin.uuang.co.id/#/loan/
${
daichaoAppInfoes
[
name
]
&&
return
`<a href="
${
daichaoAppInfoes
[
name
].
mgt
}
${
daichaoAppInfoes
[
name
]
&&
daichaoAppInfoes
[
name
].
daichaoId
||
''
}
">🏦(贷超 [
${
daichaoAppInfoes
[
name
].
daichaoId
}
] _ <
${
daichaoAppInfoes
[
name
].
name
}
>(->MGT)) | </a>`
}
if
(
ourAppIds
.
includes
(
name
))
{
...
...
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