优化代码

pull/37/head
nineven 3 years ago
parent f94184551a
commit 4bbae93933
  1. 1
      fir_ser/admin/utils/utils.py
  2. 2
      fir_ser/api/views/login_wx.py
  3. 2
      fir_ser/api/views/order.py
  4. 3
      fir_ser/xsign/views/receiveudids.py

@ -4,7 +4,6 @@
# author: NinEveN # author: NinEveN
# date: 2022/1/6 # date: 2022/1/6
from rest_framework.pagination import PageNumberPagination from rest_framework.pagination import PageNumberPagination
from rest_framework.viewsets import ModelViewSet from rest_framework.viewsets import ModelViewSet
from common.core.response import ApiResponse from common.core.response import ApiResponse

@ -86,7 +86,7 @@ class WeChatLoginCheckView(APIView):
if not Config.LOGIN.get("login_type").get('third', '').get('wxp'): if not Config.LOGIN.get("login_type").get('third', '').get('wxp'):
return Response(ret.dict) return Response(ret.dict)
ticket = request.data.get("ticket") ticket = request.data.get("ticket")
unique_key = request.data.get("unique_key") unique_key = request.data.get("unique_key", ticket)
if ticket and unique_key: if ticket and unique_key:
status, result = get_pending_result(get_wx_ticket_login_info_cache, expect_func, ticket=ticket, status, result = get_pending_result(get_wx_ticket_login_info_cache, expect_func, ticket=ticket,
locker_key=ticket, unique_key=unique_key, run_func_count=1) locker_key=ticket, unique_key=unique_key, run_func_count=1)

@ -134,7 +134,7 @@ class OrderSyncView(APIView):
def post(self, request): def post(self, request):
res = BaseResponse() res = BaseResponse()
order_number = request.data.get("order_number", None) order_number = request.data.get("order_number", None)
unique_key = request.data.get("unique_key", None) unique_key = request.data.get("unique_key", order_number)
if order_number: if order_number:
status, result = get_pending_result(get_order_obj, expect_func, order_number=order_number, run_func_count=1, status, result = get_pending_result(get_order_obj, expect_func, order_number=order_number, run_func_count=1,
locker_key=order_number, unique_key=unique_key, user_obj=request.user) locker_key=order_number, unique_key=unique_key, user_obj=request.user)

@ -18,7 +18,7 @@ from api.utils.response import BaseResponse
from common.base.baseutils import get_real_ip_address, make_random_uuid, get_server_domain_from_request from common.base.baseutils import get_real_ip_address, make_random_uuid, get_server_domain_from_request
from common.cache.storage import TaskStateCache from common.cache.storage import TaskStateCache
from common.core.sysconfig import Config from common.core.sysconfig import Config
from common.core.throttle import ReceiveUdidThrottle1, ReceiveUdidThrottle2 from common.core.throttle import ReceiveUdidThrottle1, ReceiveUdidThrottle2, VisitShortThrottle, InstallShortThrottle
from common.utils.caches import check_app_permission from common.utils.caches import check_app_permission
from common.utils.pending import get_pending_result from common.utils.pending import get_pending_result
from fir_ser.celery import app from fir_ser.celery import app
@ -104,6 +104,7 @@ def task_func(task_id, *args, **kwargs):
class TaskView(APIView): class TaskView(APIView):
throttle_classes = [VisitShortThrottle, InstallShortThrottle]
def get(self, request, short): def get(self, request, short):
res = BaseResponse() res = BaseResponse()

Loading…
Cancel
Save