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
Binary file not shown.
Binary file not shown.
+2 -1
View File
@@ -1,9 +1,10 @@
from django.urls import path, include,re_path
from jump.views import to_index,to_register,to_login
from jump.views import to_index,to_register,to_login,to_adminAccess
urlpatterns = [
path('', to_index, name="index_jump"), # 跳转首页界面
path('login', to_login, name="login_jump"), # 跳转到登录页面
path('register',to_register, name = "register_jump"), # 跳转到注册页面
path('adminAccess ',to_adminAccess, name="adminAccess_jump"), # 跳转到后台管理
]
+6
View File
@@ -28,3 +28,9 @@ def to_register(request):
注册页面
"""
return render(request,"html/register.html")
def to_adminAccess(request):
"""
后台管理
"""
return render(request,"html/adminAccess.html")
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -77,7 +77,7 @@ NAVBAR
</li>
{% if user.is_authenticated %}
<li class="nav-item">
<a class="nav-link" href="./about.html"><span class="badge badge-primary">后台管理</span></a>
<a class="nav-link" href="{% url 'adminAccess_jump' %}"><span class="badge badge-primary">后台管理</span></a>
</li>
{% endif %}
</ul>
@@ -89,7 +89,7 @@ NAVBAR
<ul class="navbar-nav ml-auto d-flex align-items-center">
<li class="nav-item highlight">
{% if user.is_authenticated %}
<a class="nav-link" href="{% url 'logout_fun' %}?#">Logout</a>
<button class="nav-link" id="logout-button">Logout</button>
{% else %}
<a class="nav-link" href="{% url 'login_jump' %}?#">Login</a>
{% endif %}
+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 %}
@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19 8L12 15L5 8" stroke="#4A4C55" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 214 B

@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M19 8L12 15L5 8" stroke="#dee2e6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Some files were not shown because too many files have changed in this diff Show More