operation.login.js
963 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* 银行信息函数
*/
(function($) {
var history = {
_id : '',
_lockVersion : 0
}
/**
* 主要的
*/
$.h.login = {
onLogin : function() {
var params = {};
$('#login_form').find('input,select').each(function() {
if (this.name && $.trim(this.value)) {
params[this.name] = this.value;
}
});
if ($.isEmptyObject(params)) return;
$.ajax({
url: '/web/passport/loginHandle',
type:'post',
cache:false,
dataType:'json',
data: {data:JSON.stringify(params)},
beforeSend: function(xhr) {
$.messager.progress({title:'请稍等...',msg:'正在提交数据...'});
},
success: function(data) {
//data = $.parseJSON(data);
if (data.code == 0) {
$(location).attr('href', data.data.url);
} else {
$.messager.alert('提示', data.msg);
}
},
complete: function() {
$.messager.progress('close');
}
});
}
}
})(jQuery);