增加登录日志

This commit is contained in:
hanhh
2021-09-07 01:40:25 +08:00
parent 0cbfca979e
commit eb196bd40d
11 changed files with 233 additions and 12 deletions
+2
View File
@@ -24,6 +24,7 @@ const dbPath = path.join(rootPath, 'db/');
const cronDbFile = path.join(rootPath, 'db/crontab.db');
const envDbFile = path.join(rootPath, 'db/env.db');
const appDbFile = path.join(rootPath, 'db/app.db');
const authDbFile = path.join(rootPath, 'db/auth.db');
const configFound = dotenv.config({ path: confFile });
@@ -60,6 +61,7 @@ export default {
cronDbFile,
envDbFile,
appDbFile,
authDbFile,
configPath,
scriptPath,
samplePath,
+3 -2
View File
@@ -158,11 +158,12 @@ export async function getNetIp(req: any) {
}
try {
const baiduApi = got
.get(`https://www.cip.cc/${ip}`, { timeout: 100000 })
.get(`https://www.cip.cc/${ip}`, { timeout: 10000, retry: 0 })
.text();
const ipApi = got
.get(`https://whois.pconline.com.cn/ipJson.jsp?ip=${ip}&json=true`, {
timeout: 100000,
timeout: 10000,
retry: 0,
})
.buffer();
const [data, ipApiBody] = await await Promise.all<any>([baiduApi, ipApi]);