This commit is contained in:
2019-09-02 14:14:55 +08:00
commit 314eee72f2
27 changed files with 969 additions and 0 deletions

30
src/control/gather.js Normal file
View File

@ -0,0 +1,30 @@
import os from 'os'
import axios from 'axios'
import { execSync } from 'child_process'
const request = axios.create()
export default async (conf) => {
const gather = (conf) => {
setTimeout(async () => {
const who = execSync('whoami')
const { version, apiURLs, AGENT_VERSION } = conf
const { data } = await request.put(apiURLs.apiURL + 'gather', {
version,
AGENT_VERSION,
user: who.toString('utf8').trim('\r\n'),
arch: os.arch(),
type: os.type(),
platform: os.platform()
})
if (data.status === 1) {
console.log('发现监控系统地址')
}
gather(conf)
}, 20000)
}
gather(conf)
}