diff --git a/public/images/1.jpg b/public/images/1.jpg index 68d55db..75a1c36 100644 Binary files a/public/images/1.jpg and b/public/images/1.jpg differ diff --git a/public/images/12.jpg b/public/images/12.jpg new file mode 100644 index 0000000..68d55db Binary files /dev/null and b/public/images/12.jpg differ diff --git a/routes/index.js b/routes/index.js index 6fdc528..4506ab2 100644 --- a/routes/index.js +++ b/routes/index.js @@ -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 = '' diff --git a/views/index.ejs b/views/index.ejs index 80f86ee..440de5c 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -60,6 +60,7 @@ <% } %>