增加登陆按回车键
This commit is contained in:
parent
f96b3772e7
commit
91feb12946
2
app.js
2
app.js
|
|
@ -30,7 +30,7 @@ app.use(session({
|
|||
saveUninitialized: true, //添加这行
|
||||
secret: 'ILoveYiJia', // 建议使用 128 个字符的随机字符串
|
||||
cookie: {
|
||||
maxAge: 3600000 * 24 * 30
|
||||
maxAge: 2592000000,
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<div class="required field">
|
||||
<label>密码</label>
|
||||
<div class="ui icon input">
|
||||
<input type="password" ng-model="password">
|
||||
<input type="password" ng-model="password" ng-keyup="myKeyup($event)">
|
||||
<i class="lock icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue