初始化项目
This commit is contained in:
44
AUTS.Web/Plugin/user.js
Normal file
44
AUTS.Web/Plugin/user.js
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
//添加会员
|
||||
$("#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);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user