diff --git a/panel/server.js b/panel/server.js index ae78fda20f19d47f4456ef8a9e59b79f3f7c8f02..e2684dedd3a1b54235baadbdeed3ca5b5a7c8f72 100755 --- a/panel/server.js +++ b/panel/server.js @@ -467,7 +467,7 @@ app.use(express.static(path.join(__dirname, 'public'))); app.get('/', function (request, response) { let OldIPContent = getFileContentByName(logPath + 'panel.txt'); let date = new Date(); - let bakConfFile = '时间为:' + date.getFullYear() + '-' + date.getMonth() + '-' + date.getDay() + '-' + date.getHours() + '-' + date.getMinutes() + '-' + date.getMilliseconds(); + let bakConfFile = '时间为:' + date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds(); OldIPContent = OldIPContent + '\n' + '访问您【首页】的IP为' + getClientIP(request) + bakConfFile + '\n'; fs.writeFileSync(logPath + 'panel.txt', OldIPContent); if (request.session.loggedin) { @@ -811,7 +811,7 @@ app.post('/login', function (request, response) { //setTimeout(function() { callback(null); }, 8000); ErrorTimes = ErrorTimes + 1; let date = new Date(); - let bakConfFile = '时间为:' + date.getFullYear() + '-' + date.getMonth() + '-' + date.getDay() + '-' + date.getHours() + '-' + date.getMinutes() + '-' + date.getMilliseconds(); + let bakConfFile = '时间为:' + date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds(); OldIPContent = OldIPContent + '\n' + '【输入密码错误】,访问IP为' + getClientIP(request) + bakConfFile + '\n'; if (ErrorTimes > 29) { OldIPContent = OldIPContent + '面板检测到有暴力破解的行为,已关闭登入系统' + '\n';