use spinner instead of showing alert while logging®istering
This commit is contained in:
parent
79c050da98
commit
52eaaa932a
|
|
@ -2,7 +2,7 @@
|
||||||
* @Author: printempw
|
* @Author: printempw
|
||||||
* @Date: 2016-01-21 13:55:44
|
* @Date: 2016-01-21 13:55:44
|
||||||
* @Last Modified by: printempw
|
* @Last Modified by: printempw
|
||||||
* @Last Modified time: 2016-03-19 10:08:46
|
* @Last Modified time: 2016-03-26 23:07:15
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
@ -17,7 +17,7 @@ var login = function() {
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: { "uname": uname, "passwd": passwd },
|
data: { "uname": uname, "passwd": passwd },
|
||||||
beforeSend: function() {
|
beforeSend: function() {
|
||||||
showMsg('alert-info', '登录中。。');
|
$('#login-button').html('<i class="fa fa-spinner fa-spin"></i> 登录中').prop('disabled', 'disabled');
|
||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
console.log(json);
|
console.log(json);
|
||||||
|
|
@ -33,7 +33,7 @@ var login = function() {
|
||||||
window.setTimeout('window.location = "./user/index.php"', 1000);
|
window.setTimeout('window.location = "./user/index.php"', 1000);
|
||||||
} else {
|
} else {
|
||||||
showAlert(json.msg);
|
showAlert(json.msg);
|
||||||
showMsg('hide', '');
|
$('#login-button').html('登录').prop('disabled', '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(json) {
|
error: function(json) {
|
||||||
|
|
@ -53,7 +53,7 @@ var register = function() {
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: {'uname':uname, 'passwd':passwd},
|
data: {'uname':uname, 'passwd':passwd},
|
||||||
beforeSend: function() {
|
beforeSend: function() {
|
||||||
showMsg('alert-info', '注册中...');
|
$('#register-button').html('<i class="fa fa-spinner fa-spin"></i> 注册中').prop('disabled', 'disabled');
|
||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
if (json.errno == 0) {
|
if (json.errno == 0) {
|
||||||
|
|
@ -67,7 +67,7 @@ var register = function() {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
showAlert(json.msg);
|
showAlert(json.msg);
|
||||||
showMsg('hide', "");
|
$('#register-button').html('注册').prop('disabled', '');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(json) {
|
error: function(json) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* @Author: printempw
|
* @Author: printempw
|
||||||
* @Date: 2016-01-17 13:55:20
|
* @Date: 2016-01-17 13:55:20
|
||||||
* @Last Modified by: printempw
|
* @Last Modified by: printempw
|
||||||
* @Last Modified time: 2016-03-26 22:28:22
|
* @Last Modified time: 2016-03-26 23:09:06
|
||||||
*/
|
*/
|
||||||
session_start();
|
session_start();
|
||||||
$dir = dirname(__FILE__);
|
$dir = dirname(__FILE__);
|
||||||
|
|
@ -28,6 +28,7 @@ if (isset($_COOKIE['uname']) && isset($_COOKIE['token'])) {
|
||||||
<link rel="shortcut icon" href="./assets/images/favicon.ico">
|
<link rel="shortcut icon" href="./assets/images/favicon.ico">
|
||||||
<link rel="stylesheet" href="./assets/libs/pure/pure-min.css">
|
<link rel="stylesheet" href="./assets/libs/pure/pure-min.css">
|
||||||
<link rel="stylesheet" href="./assets/libs/pure/grids-responsive-min.css">
|
<link rel="stylesheet" href="./assets/libs/pure/grids-responsive-min.css">
|
||||||
|
<link rel="stylesheet" href="../assets/libs/font-awesome/css/font-awesome.min.css">
|
||||||
<link rel="stylesheet" href="./assets/css/style.css">
|
<link rel="stylesheet" href="./assets/css/style.css">
|
||||||
<link rel="stylesheet" href="./assets/css/index.style.css">
|
<link rel="stylesheet" href="./assets/css/index.style.css">
|
||||||
<link rel="stylesheet" href="./assets/libs/remodal/remodal.css">
|
<link rel="stylesheet" href="./assets/libs/remodal/remodal.css">
|
||||||
|
|
@ -102,7 +103,6 @@ if (isset($_COOKIE['uname']) && isset($_COOKIE['token'])) {
|
||||||
</label>
|
</label>
|
||||||
<button id="login-button" class="pure-button pure-button-primary">登录</button>
|
<button id="login-button" class="pure-button pure-button-primary">登录</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="msg" class="alert"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<?php if (Option::get('user_can_register') == 1): ?>
|
<?php if (Option::get('user_can_register') == 1): ?>
|
||||||
<div class="remodal" data-remodal-id="register-modal">
|
<div class="remodal" data-remodal-id="register-modal">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user