From 81dfa4c4cb3830d840f01a3307d4322738dd610a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=40jkccchen123?= <893824054@qq.com> Date: Mon, 24 Jun 2024 20:28:41 +0800 Subject: [PATCH] jk2024.06.24-20:28 --- www/main.js | 9 +-------- www/static/work1.html | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/www/main.js b/www/main.js index d57ac8d..660c70f 100644 --- a/www/main.js +++ b/www/main.js @@ -44,16 +44,13 @@ app.get('/', function (req, res) { } result_string +='\r\n'; result_string +='注册用户\r\n' - result_string +='
\r\n'; result_string +='登陆界面\r\n'; result_string +='
\r\n'; - res.send(result_string + build_html_foot()) }); }) - // 文件上传接口 app.post('/fileUpload', function(req, res){ // 上传的文件在req.files中 @@ -69,7 +66,6 @@ app.post('/fileUpload', function(req, res){ }) }) - const session = require('express-session'); app.use(session({ secret: 'your_secret_key', // 密钥用于会话加密 @@ -114,7 +110,6 @@ app.post('/idcheck', urlencodedParser, function(req, res) { res.send('数据库查询错误!'); return; } - if (results.length > 0 && results[0].id === 'admin') { res.send({ userid: 'admin' }); } else { @@ -155,7 +150,6 @@ function build_html_foot() { return '\r\n'; } - var server = app.listen(8081, function () { var host = server.address().address @@ -170,5 +164,4 @@ var server = app.listen(8081, function () { }); console.log("应用实例,访问地址为 http://%s:%s", host, port) -}) - +}) \ No newline at end of file diff --git a/www/static/work1.html b/www/static/work1.html index 53b9e8f..a42b223 100644 --- a/www/static/work1.html +++ b/www/static/work1.html @@ -69,7 +69,7 @@