From 91feb129465b1edc67c3e246dc51c5379dc578ca Mon Sep 17 00:00:00 2001 From: luchenqun Date: Wed, 18 Jan 2017 11:13:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=99=BB=E9=99=86=E6=8C=89?= =?UTF-8?q?=E5=9B=9E=E8=BD=A6=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- database/db.js | 6 +++--- public/scripts/controllers/login-controller.js | 7 +++++++ public/views/login.html | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index b10238f..3a74bab 100644 --- a/app.js +++ b/app.js @@ -30,7 +30,7 @@ app.use(session({ saveUninitialized: true, //添加这行 secret: 'ILoveYiJia', // 建议使用 128 个字符的随机字符串 cookie: { - maxAge: 3600000 * 24 * 30 + maxAge: 2592000000, } })); diff --git a/database/db.js b/database/db.js index 2c1a80e..ea0c843 100644 --- a/database/db.js +++ b/database/db.js @@ -1,8 +1,8 @@ var mysql = require('mysql'); var client = mysql.createConnection({ - host: '127.0.0.1'|| '172.24.13.5', - user: 'lcq'|| 'root', - password: 'fendoubuxi596320'|| 'root123', + host: '127.0.0.1', + user: 'lcq', + password: 'fendoubuxi596320', database: 'mybookmarks', multipleStatements: true, port: 3306 diff --git a/public/scripts/controllers/login-controller.js b/public/scripts/controllers/login-controller.js index 1210408..2c035ed 100644 --- a/public/scripts/controllers/login-controller.js +++ b/public/scripts/controllers/login-controller.js @@ -11,6 +11,13 @@ app.controller('loginCtr', ['$scope', '$filter', '$state', '$cookieStore', 'book $scope.showErr = false; $scope.errInfo = ''; + $scope.myKeyup = function(e) { + var keycode = window.event ? e.keyCode : e.which; + if (keycode == 13) { + $scope.login(); + } + }; + $scope.login = function() { var autoLogin = $('.ui.checkbox.js-auto-login').checkbox('is checked'); if (!$scope.username || !$scope.password) { diff --git a/public/views/login.html b/public/views/login.html index ab9c726..4399a04 100644 --- a/public/views/login.html +++ b/public/views/login.html @@ -14,7 +14,7 @@
- +