From 6c89ef2fc8a32f7125e6a06d5a6adb8a7c64c877 Mon Sep 17 00:00:00 2001 From: life Date: Wed, 23 Sep 2015 23:14:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E7=94=A8=E6=88=B7=E4=BC=98?= =?UTF-8?q?=E5=8C=96,=20=E7=99=BB=E5=BD=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 登录只需要user表启动 --- src/login.html | 42 ++++----- src/node_modules/db.js | 53 ++++++++--- src/node_modules/note.js | 48 +++++----- src/public/css/index.css | 121 ++++--------------------- src/public/css/index.less | 136 +++++------------------------ src/public/js/app/service.js | 3 + src/public/js/app/service_login.js | 3 + src/public/langs/zh-cn.js | 9 +- src/public/langs/zh-hk.js | 9 +- 9 files changed, 147 insertions(+), 277 deletions(-) diff --git a/src/login.html b/src/login.html index bbf27586..bf792ba9 100644 --- a/src/login.html +++ b/src/login.html @@ -44,8 +44,10 @@ if(process.platform != 'darwin') { Create Local Account - -
+
+ +
+
@@ -59,7 +61,10 @@ if(process.platform != 'darwin') {
- +
@@ -78,7 +83,10 @@ if(process.platform != 'darwin') {
- +
@@ -138,6 +146,9 @@ $(function() { var $email = $("#email"); var $host = $('#host'); + var $body = $('body'); + + $("#loginBtn").click(function(e) { e.preventDefault(); var email = $email.val(); @@ -161,7 +172,7 @@ $(function() { showMsg(getMsg('Invalid host'), 'host'); return; } - $('#loadingLogo').addClass('loading'); + $body.addClass('loading'); hideMsg(); // TODO show loading // console.log(33); @@ -172,7 +183,7 @@ $(function() { UserService.login(email, pwd, function(ret) { if (ret) { setTimeout(function(){ - $('#loadingLogo').removeClass('loading'); + $body.removeClass('loading'); goToMainPage(); gui.getCurrentWindow().close(); }, 2000); @@ -181,12 +192,12 @@ $(function() { ApiService.auth(email, pwd, host, function(ret) { if(ret.Ok) { setTimeout(function(){ - $('#loadingLogo').removeClass('loading'); + $body.removeClass('loading'); goToMainPage(); gui.getCurrentWindow().close(); }, 2000); } else { - $('#loadingLogo').removeClass('loading'); + $body.removeClass('loading'); showMsg(getMsg("Email or Password Error")); } }); @@ -214,7 +225,7 @@ $(function() { return; } } - $('#loadingLogo').addClass('loading'); + $body.addClass('loading'); hideMsg(); var user = {}; user.Username = username; @@ -225,13 +236,13 @@ $(function() { dbuser.UserId = dbuser._id; UserService.saveCurUser(dbuser, function() { setTimeout(function(){ - $('#loadingLogo').removeClass('loading'); + $body.removeClass('loading'); goToMainPage(); gui.getCurrentWindow().close(); }, 2000); }) } else { - $('#loadingLogo').removeClass('loading'); + $body.removeClass('loading'); showMsg(getMsg(dbuser)); } }); @@ -269,9 +280,6 @@ $(function() { checkDisabled(); }); }); - - var $body = $('body'); - $('#customServer').click(function() { $body.addClass('custom-server'); $host.focus(); @@ -290,12 +298,6 @@ $(function() { $email.focus(); hideMsg(); }); - - // setTimeout(function () { - // var s = $('