mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2024-04-21 12:31:40 +00:00
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
$("#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;
|
|
}) |