diff --git a/views/book/setting.tpl b/views/book/setting.tpl index 0fb56b96..cc97f515 100644 --- a/views/book/setting.tpl +++ b/views/book/setting.tpl @@ -168,7 +168,7 @@ @@ -229,7 +229,7 @@ @@ -278,16 +278,24 @@ }); $("#changePrivatelyOwnedForm").ajaxForm({ + beforeSumbit :function () { + $("#btnChangePrivatelyOwned").button("loading"); + }, success :function (res) { if(res.errcode === 0){ window.location = window.location.href; }else{ - console.log(res.message) showError(res.message,"#form-error-message1"); } - } + $("#btnChangePrivatelyOwned").button("reset"); + }, + error :function () { + showError("服务器异常","#form-error-message1"); + $("#btnChangePrivatelyOwned").button("reset"); + } }); + $("#createToken,#deleteToken").on("click",function () { var btn = $(this).button("loading"); var action = $(this).attr("data-action"); @@ -335,13 +343,20 @@ } }); $("#deleteBookForm").ajaxForm({ + beforeSubmit : function () { + $("#btnDeleteBook").button("loading"); + }, success : function (res) { if(res.errcode === 0){ window.location = "{{urlfor "BookController.Index"}}"; }else{ - console.log(res.message) showError(res.message,"#form-error-message2"); } + $("#btnDeleteBook").button("reset"); + }, + error : function () { + showError("服务器异常","#form-error-message2"); + $("#btnDeleteBook").button("reset"); } }); $("#transferBookForm").ajaxForm({