0.1.1
This commit is contained in:
30
src/control/gather.js
Normal file
30
src/control/gather.js
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user