add 后台管理页面

This commit is contained in:
2024-09-06 14:37:47 +08:00
parent 23bff01191
commit 7b57fb645f
737 changed files with 138757 additions and 5 deletions
+27 -1
View File
@@ -8,5 +8,31 @@
{% endblock %}
{% block js %}
<script src="https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script>
//注销
function logout_() {
$.ajax({
url: '/api/account/logout', // 后端接口地址
type: "POST",
headers: {"X-CSRFToken": $.cookie("csrftoken")},
data: {},
dataType: "json",
success: function (data) {
alert(data.msg); // 使用 alert 替换 common_alert
setTimeout(function () {
location.reload();
}, 1000);
},
async: false
});
}
$(document).ready(function() {
// 绑定注销操作到某个按钮点击事件
$('#logout-button').click(function(event) {
event.preventDefault(); // 阻止默认行为
logout_();
});
});
</script>
{% endblock %}