:building:修复二次验证错误

This commit is contained in:
sunxiaolong
2024-01-08 00:12:06 +08:00
parent c5ffb6c039
commit bfe1caeeae
8 changed files with 238 additions and 64 deletions

View File

@@ -142,6 +142,32 @@
</div>
</div>
</div>
<div class="modal fade" id="delete-solve" tabindex="-1" role="dialog" aria-labelledby="myModalDeleteLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">二次验证</h4>
</div>
<div class="modal-body modal-body-order-solve">
<input type="text" id="account-uid-delete" hidden>
<div>
<label>
二次验证:
<input type="text" value="" id="order-info-delete-totp">
</label>
</div>
<div>
<p class="error-msg" style="color: red"></p>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default account-delete-save">确定</button>
<button type="button" class="btn btn-default cancel-order-solve" data-dismiss="modal">取消</button>
</div>
</div>
</div>
</div>
</body>
<script>
function getAccountCutPageValues() {
@@ -199,7 +225,7 @@
`<button type="button" value="${v.AccountUid}" class="btn btn-default" onclick="showTotpModal(this.value)">变更钱包余额</button>` +
'<button type="button" value="' +
v.AccountUid +
'" class="btn btn-default" onclick="deleteAccount(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'" class="btn btn-default" onclick="showDeleteModal(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
'</div>' +
"</th>" +
"</tr>";
@@ -220,9 +246,9 @@
},
success: function (res) {
if (res.Code == 404) {
if (res.Code === 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
} else if (res.Code === -1) {
alert("操作失败");
} else {
alert("操作成功");
@@ -235,29 +261,6 @@
});
}
function deleteAccount(accountUid) {
$.ajax({
url: "/delete/account",
data: {
"accountUid": accountUid
},
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
alert(res.Msg);
} else {
alert("操作成功");
ajaxAccountList(getAccountCutPageValues());
}
},
error: function (res) {
alert("系统异常,请稍后再试");
}
});
}
function ajaxAccountList(dataJSON) {
$.ajax({
url: "/get/account",
@@ -311,6 +314,39 @@
}
});
});
$(".account-delete-save").click(function () {
const accountUid = $("#account-uid-delete").val();
const totpCode = $("#order-info-delete-totp").val();
if (accountUid === "") {
$(".error-msg").text("信息填写不完全,请重新填写");
return
}
$.ajax({
url: "/delete/account",
data: {
accountUid: accountUid,
totpCode: totpCode,
},
success: function (res) {
if (res.Code === 404) {
window.parent.location = "/login.html";
} else if (res.Code === -1) {
alert(res.Msg);
} else {
alert("操作成功");
$(".cancel-order-solve").click();
ajaxAccountList(getAccountCutPageValues());
}
},
error: function (res) {
alert("系统异常,请稍后再试");
}
});
})
//当每页显示数更改后,执行的操作
$("#display_count").change(function () {
let dataJSON = getAccountCutPageValues();
@@ -358,9 +394,13 @@
});
function showTotpModal(merchantUid) {
console.log(merchantUid)
$("#account-solve").modal("show");
$("#account-uid-edit").val(merchantUid);
}
function showDeleteModal(merchantUid) {
$("#delete-solve").modal("show");
$("#account-uid-delete").val(merchantUid);
}
</script>
</html>