From e265336aa62a0e234e3934de183ddc8ce0685f1b Mon Sep 17 00:00:00 2001
From: tonkia
Date: Wed, 19 Dec 2018 07:35:42 +0800
Subject: [PATCH] add login page
---
app.js | 23 +++++++++++--
static/img/webbg.jpg | Bin 0 -> 19872 bytes
static/js/createScheme.js | 25 +++++++++------
views/createScheme.html | 25 +++++++++++++++
views/home.html | 23 +++++++++++++
views/login.html | 66 ++++++++++++++++++++++++++++++++++++++
6 files changed, 150 insertions(+), 12 deletions(-)
create mode 100644 static/img/webbg.jpg
create mode 100644 views/home.html
create mode 100644 views/login.html
diff --git a/app.js b/app.js
index d4b3bbd..d69a84c 100644
--- a/app.js
+++ b/app.js
@@ -11,11 +11,28 @@ app.use(express.static('static'));
//临时存储数据
var data = { name: '默认方案', components: [] };
+var acc = 'tonkia';
+var pwd = '123';
-
-//主页加载
+//主页加载:登录页面
app.get('/', function (req, res) {
- res.sendFile(__dirname + "/views/createScheme.html");
+ res.sendFile(__dirname + "/views/login.html");
+});
+
+//登录
+app.post('/', function (req, res) {
+ var account = req.body.account;
+ var password = req.body.password;
+ //用户验证
+ if (account == acc && password == pwd) {
+ res.send('登录成功');
+ } else {
+ res.send('登录失败');
+ }
+});
+
+app.get('/home', function (req, res) {
+ res.sendFile(__dirname + "/views/home.html");
});
//接受文件上传,并且返回文件名
diff --git a/static/img/webbg.jpg b/static/img/webbg.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..51d7e702893ad94ec3c85144408d5119b59f9aba
GIT binary patch
literal 19872
zcmeHP30M>7*8W^j0X1mBwRKvTf}oe`RViwjwqA&0EjMhk6w~Vlf?Tf(wNk^>`YRRG
zlp;{IHe$*u0gHR+je#VX)+xwX?Zk)k5!wE)4
zh7$}8jV9728W~SEHZ+_xWzuAtiOCcbqlr^rnQHP1+%_S91jZ9a?;Z=qP66Z%fB-Pc
zp!XJ|Mgi?-)aWr|4aSY1U}$6v2V|Ro(WAzU89jE4fx+0Za5M{^2V{UL|`=kSrRFOP1f?vcvm
z3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Q;tkki8&V&9WNk=ofyO}+MWyzUsSi=)U
z)xvM!bW0^koLJ7HUIAJC7Z*DOYRfqoO?B^M" + data.components[componentIndex].models[index].name + "");
+ $('#modelList').append("" + data.components[componentIndex].models[index].name + "");
} else {
data.components[componentIndex].models[index].modelObj.visible = false;
- $('#modelList').append("" + data.components[componentIndex].models[index].name + "");
+ $('#modelList').append("" + data.components[componentIndex].models[index].name + "");
}
}
}
@@ -106,6 +106,20 @@ function delModelItem(index) {
event.stopPropagation();
}
+//点击事件:修改模型名称
+function changeModelName(index) {
+ $('#modelName').val(data.components[componentIndex].models[index].name);
+ $('#changeModelNameModal').modal('show');
+ $('#changeModelName').unbind('click');
+ $('#changeModelName').click(function () {
+ if ($('#modelName').val().trim().length > 0) {
+ data.components[componentIndex].models[index].name = $('#modelName').val();
+ $('#changeModelNameModal').modal('hide');
+ freshModelList();
+ }
+ });
+}
+
//刷新贴图列表
function freshTextureList() {
$('#textureList').empty();
@@ -113,7 +127,6 @@ function freshTextureList() {
var fileName = data.components[componentIndex].textures[index].name;
var fileId = data.components[componentIndex].textures[index].fileId;
$('#textureList').append(" ");
-
}
}
@@ -329,9 +342,6 @@ function initEvent() {
type: 'post',
url: "/upload",
data: formData,
- cache: false,
- processData: false,
- contentType: false,
success: function (fileData) {
//上传成功后加载模型
//加载是异步的
@@ -360,9 +370,6 @@ function initEvent() {
type: 'post',
url: "/upload",
data: formData,
- cache: false,
- processData: false,
- contentType: false,
success: function (fileData) {
//上传成功后加载模型
//加载是异步的
diff --git a/views/createScheme.html b/views/createScheme.html
index 15cbade..7273585 100644
--- a/views/createScheme.html
+++ b/views/createScheme.html
@@ -146,6 +146,31 @@
+
+
+
+
+
+ 良辰美景
+ 良辰美景奈何天,赏心乐事谁家院。
+
+
+
diff --git a/views/home.html b/views/home.html
new file mode 100644
index 0000000..0fffbdf
--- /dev/null
+++ b/views/home.html
@@ -0,0 +1,23 @@
+
+
+
+