You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cloudreve/static/js/admin/add_group.js

38 lines
1.1 KiB

$("#addGroup").submit(function() {
$("#saveGroup").attr("disabled", "true");
$.post("/Admin/AddGroup",
$("#addGroup").serialize()
, function(data) {
if (data.error == "1") {
toastr["warning"](data.msg);
$("#saveGroup").removeAttr("disabled");
} else if (data.error == "200") {
toastr["success"]("用户组已添加");
document.getElementById("addGroup").reset();
$("#saveGroup").removeAttr("disabled");
}else{
toastr["warning"]("未知错误");
$("#saveGroup").removeAttr("disabled");
}
});
return false;
})
$("#editGroup").submit(function() {
$("#saveGroup").attr("disabled", "true");
$.post("/Admin/SaveGroup",
$("#editGroup").serialize()
, function(data) {
if (data.error == "1") {
toastr["warning"](data.msg);
$("#saveGroup").removeAttr("disabled");
} else if (data.error == "200") {
toastr["success"]("用户组已添加");
location.href="/Admin/GroupList"
$("#saveGroup").removeAttr("disabled");
}else{
toastr["warning"]("未知错误");
$("#saveGroup").removeAttr("disabled");
}
});
return false;
})