update log system

pull/3/head
zyp 3 weeks ago
parent 3f13857294
commit a5e24a3d1d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

@ -169,24 +169,24 @@ router.post('/login', urlencodedParser, function (req, res, next) {
res.redirect('login');
} else {
username = name
var exec = require('child_process').exec;
exec(`python C:/Users/17217/Desktop/english/users/admin/log.py `+username)
db.run("delete from "+name,function(){ //每次先将表信息清空再重新读取文件夹里面的文件信息
});
fs.readdir('./users/'+name, 'utf8', function(err, data) {
console.log(data);
for (var key in data) {
console.log(key);
var a=key
console.log(data[key]);
var b=data[key]
var c = fs.statSync(path.join(__dirname,'../users/'+name+'/'+data[key]))
console.log(c.size)
var add = db.prepare("INSERT INTO "+name+"(fid,fname,fsize,fowner) VALUES(?,?,?,?)");//读取用户名文件夹下文件ID、文件名、大小并写入数据库中
add.run(a,b,c.size,name);
add.finalize();
}
})
// var exec = require('child_process').exec;
// exec(`python C:/Users/17217/Desktop/english/users/admin/log.py `+username)
// db.run("delete from "+name,function(){ //每次先将表信息清空再重新读取文件夹里面的文件信息
// });
// fs.readdir('./users/'+name, 'utf8', function(err, data) {
// console.log(data);
// for (var key in data) {
// console.log(key);
// var a=key
// console.log(data[key]);
// var b=data[key]
// var c = fs.statSync(path.join(__dirname,'../users/'+name+'/'+data[key]))
// console.log(c.size)
// var add = db.prepare("INSERT INTO "+name+"(fid,fname,fsize,fowner) VALUES(?,?,?,?)");//读取用户名文件夹下文件ID、文件名、大小并写入数据库中
// add.run(a,b,c.size,name);
// add.finalize();
// }
// })
if (name == 'admin')
{
req.session.error = ''

@ -60,6 +60,7 @@
<% } %>
<h1> <a href="/zuozhan">作战员1入口</a></h1>
<h1> <a href="/zuozhan2">作战员2入口</a></h1>
<h1> <a href="http://192.168.98.242:80">侦查员入口</a></h1>
<h1> <a href="/guanli">用户信息管理</a></h1>
<h1> <%= message %> <a href="/logout">退出登录</a></h1>
</div>

Loading…
Cancel
Save