CMS_Django_Backend/apps/api/views.py
2024-08-18 20:51:27 +08:00

16 lines
512 B
Python

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("报错了")