|
@@ -25,6 +25,8 @@ var $emailAutoComplete = $('#email-autocomplete'); |
|
@@ -25,6 +25,8 @@ var $emailAutoComplete = $('#email-autocomplete'); |
25
|
|
25
|
|
26
|
var mailPhoneRegx = require('./mail-phone-regx');
|
26
|
var mailPhoneRegx = require('./mail-phone-regx');
|
27
|
|
27
|
|
|
|
28
|
+var $remember = $('.remember-me');
|
|
|
29
|
+
|
28
|
//checkbox status unicode
|
30
|
//checkbox status unicode
|
29
|
var checkbox = {
|
31
|
var checkbox = {
|
30
|
checked: '',
|
32
|
checked: '',
|
|
@@ -232,7 +234,7 @@ $emailAutoComplete.on('click', 'li', function() { |
|
@@ -232,7 +234,7 @@ $emailAutoComplete.on('click', 'li', function() { |
232
|
});
|
234
|
});
|
233
|
|
235
|
|
234
|
//记住登录状态
|
236
|
//记住登录状态
|
235
|
-$('.remeber-me').on('click', function() {
|
237
|
+$remember.on('click', function() {
|
236
|
var $this = $(this);
|
238
|
var $this = $(this);
|
237
|
|
239
|
|
238
|
$this.toggleClass('checked');
|
240
|
$this.toggleClass('checked');
|
|
@@ -266,15 +268,19 @@ $('#login-btn').on('click', function() { |
|
@@ -266,15 +268,19 @@ $('#login-btn').on('click', function() { |
266
|
data: {
|
268
|
data: {
|
267
|
areaCode: $countryCodeHide.val().replace('+', ''),
|
269
|
areaCode: $countryCodeHide.val().replace('+', ''),
|
268
|
account: $.trim($account.val()),
|
270
|
account: $.trim($account.val()),
|
269
|
- password: $.trim($password.val())
|
271
|
+ password: $.trim($password.val()),
|
|
|
272
|
+ isRemember: $remember.hasClass('checked') ? true : false
|
270
|
},
|
273
|
},
|
271
|
success: function(data) {
|
274
|
success: function(data) {
|
272
|
- if (data.code === 400) {
|
275
|
+ if (data.code === 200) {
|
|
|
276
|
+ if (data.data) {
|
|
|
277
|
+
|
|
|
278
|
+ //防止data.data为undefined时下行语句执行出错而导致脚本不能走到complete去处理authing
|
|
|
279
|
+ location.href = data.data.href;
|
|
|
280
|
+ }
|
|
|
281
|
+ } else {
|
273
|
$passwordTip.removeClass('hide').children('em').text(data.message);
|
282
|
$passwordTip.removeClass('hide').children('em').text(data.message);
|
274
|
$password.addClass('error');
|
283
|
$password.addClass('error');
|
275
|
- return;
|
|
|
276
|
- } else {
|
|
|
277
|
- location.href = data.data.href;
|
|
|
278
|
}
|
284
|
}
|
279
|
},
|
285
|
},
|
280
|
complete: function() {
|
286
|
complete: function() {
|