CMS_Django_Backend/apps/api/views.py

16 lines
512 B
Python
Raw Normal View History

2024-08-18 20:51:27 +08:00
from django.shortcuts import HttpResponse
from apps.api import models as m_api
from django.views.decorators.http import require_http_methods, require_POST, require_GET
# Create your views here.
@require_POST
def getconfig(request):
try:
param = request.POST.get("param")
title = m_api.SysConfig.objects.filter(identity=param).first().param
return HttpResponse(title)
except Exception as e:
print(f"报错了:{e}")
return HttpResponse("报错了")