update
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
from django.urls import path
|
from django.urls import path
|
||||||
|
|
||||||
from server.views.mind_map import *
|
from server.views.mind_map import *
|
||||||
|
from server.views.jump import *
|
||||||
from server.views.user import *
|
from server.views.user import *
|
||||||
from server.view_test import *
|
from server.view_test import *
|
||||||
from server_auth.lib.auth import *
|
from server_auth.lib.auth import *
|
||||||
@@ -10,9 +11,9 @@ urlpatterns = [
|
|||||||
path('test', test), #
|
path('test', test), #
|
||||||
|
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------
|
||||||
|
path('dashboard', to_dashboard), #
|
||||||
path('', to_list), # 跳转列表界面
|
path('', to_list), # 跳转列表界面
|
||||||
path('detail', to_detail), # 跳转详情界面
|
path('detail', to_detail), # 跳转详情界面
|
||||||
path('dashboard', to_dashboard), #
|
|
||||||
|
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------
|
||||||
path('create', JsMindView.as_view()), # 创建思维导图
|
path('create', JsMindView.as_view()), # 创建思维导图
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
from django.shortcuts import render
|
||||||
|
|
||||||
|
|
||||||
|
def to_dashboard(request):
|
||||||
|
"""
|
||||||
|
界面
|
||||||
|
"""
|
||||||
|
return render(request, "html/dashboard.html")
|
||||||
|
|
||||||
|
|
||||||
|
def to_list(request):
|
||||||
|
"""
|
||||||
|
列表界面
|
||||||
|
"""
|
||||||
|
return render(request, "html/list.html")
|
||||||
|
|
||||||
|
|
||||||
|
def to_detail(request):
|
||||||
|
"""
|
||||||
|
详情页面
|
||||||
|
"""
|
||||||
|
param = {'id': request.GET.get('id')}
|
||||||
|
return render(request, "html/detail.html", param)
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
from datetime import datetime as dt
|
from datetime import datetime as dt
|
||||||
|
|
||||||
from django.shortcuts import render
|
from django.contrib.auth.decorators import login_required
|
||||||
from django_filters.rest_framework import DjangoFilterBackend
|
from django_filters.rest_framework import DjangoFilterBackend
|
||||||
from rest_framework.generics import *
|
from rest_framework.generics import *
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
@@ -9,30 +9,6 @@ from server.filters import CooperationMindFilter
|
|||||||
from server.serializers import *
|
from server.serializers import *
|
||||||
from server.util.mix_util import build_response
|
from server.util.mix_util import build_response
|
||||||
from server.util.pagination import NewPagination
|
from server.util.pagination import NewPagination
|
||||||
from django.contrib.auth.decorators import login_required
|
|
||||||
|
|
||||||
|
|
||||||
def to_dashboard(request):
|
|
||||||
"""
|
|
||||||
界面
|
|
||||||
"""
|
|
||||||
print(request.user)
|
|
||||||
return render(request, "html/dashboard.html")
|
|
||||||
|
|
||||||
|
|
||||||
def to_list(request):
|
|
||||||
"""
|
|
||||||
列表界面
|
|
||||||
"""
|
|
||||||
return render(request, "html/list.html")
|
|
||||||
|
|
||||||
|
|
||||||
def to_detail(request):
|
|
||||||
"""
|
|
||||||
详情页面
|
|
||||||
"""
|
|
||||||
param = {'id': request.GET.get('id')}
|
|
||||||
return render(request, "html/detail.html", param)
|
|
||||||
|
|
||||||
|
|
||||||
class JsMindView(ListAPIView):
|
class JsMindView(ListAPIView):
|
||||||
@@ -58,6 +34,7 @@ class JsMindView(ListAPIView):
|
|||||||
return build_response(data=serializer.data)
|
return build_response(data=serializer.data)
|
||||||
return self.list(request, *args, **kwargs)
|
return self.list(request, *args, **kwargs)
|
||||||
|
|
||||||
|
@login_required(login_url="dashboard")
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
"""
|
"""
|
||||||
创建思维导图
|
创建思维导图
|
||||||
@@ -69,6 +46,7 @@ class JsMindView(ListAPIView):
|
|||||||
mind.save()
|
mind.save()
|
||||||
return build_response(data=mind.id)
|
return build_response(data=mind.id)
|
||||||
|
|
||||||
|
@login_required(login_url="dashboard")
|
||||||
def delete(self, request):
|
def delete(self, request):
|
||||||
# 删除
|
# 删除
|
||||||
pk = request.POST.get('id')
|
pk = request.POST.get('id')
|
||||||
@@ -82,6 +60,7 @@ class JsMindLogView(APIView):
|
|||||||
日志获取,快照保存
|
日志获取,快照保存
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@login_required(login_url="dashboard")
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
"""
|
"""
|
||||||
查询日志
|
查询日志
|
||||||
@@ -93,6 +72,7 @@ class JsMindLogView(APIView):
|
|||||||
log_list = CooperationMindLogSerializer(query_set, many=True)
|
log_list = CooperationMindLogSerializer(query_set, many=True)
|
||||||
return build_response(data=log_list.data)
|
return build_response(data=log_list.data)
|
||||||
|
|
||||||
|
@login_required(login_url="dashboard")
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
"""
|
"""
|
||||||
更新保存快照
|
更新保存快照
|
||||||
|
|||||||
Reference in New Issue
Block a user