45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
|
|
|
|||
|
|
//添加会员
|
|||
|
|
$("#btnaddUser").click(function () {
|
|||
|
|
console.log("123");
|
|||
|
|
var btnText = $('#btnaddUser').html()
|
|||
|
|
$("#btnaddUser").attr("disabled", "true"); //设置禁用按钮
|
|||
|
|
$('#btnaddUser').text('提交中...'); //显示提交中
|
|||
|
|
|
|||
|
|
$("#addUserForm").ajaxSubmit({
|
|||
|
|
url: "/APP/user/AddUser",
|
|||
|
|
type: "post",
|
|||
|
|
success: function (res) {
|
|||
|
|
if (res.Status == 200) {
|
|||
|
|
$.toastr.success('添加成功',
|
|||
|
|
{
|
|||
|
|
position: 'top-center',
|
|||
|
|
time: 2000,
|
|||
|
|
callback: function () {
|
|||
|
|
location.href = "/APP/User/UserList";
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
} else {
|
|||
|
|
|
|||
|
|
$.toastr.error('添加失败! <br />' + res.Message, {
|
|||
|
|
time: 3000,
|
|||
|
|
position: 'top-center'
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$('#btnaddUser').removeAttr('disabled')//重置按钮
|
|||
|
|
$('#btnaddUser').text(btnText); //还原显示
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
error: function (error) {
|
|||
|
|
$('#btnaddUser').removeAttr('disabled')//重置按钮
|
|||
|
|
$('#btnaddUser').text(btnText); //还原显示
|
|||
|
|
alert(error);
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
|