diff --git a/fir_ser/admin/utils/utils.py b/fir_ser/admin/utils/utils.py index bbe7da6..60e6b89 100644 --- a/fir_ser/admin/utils/utils.py +++ b/fir_ser/admin/utils/utils.py @@ -4,7 +4,6 @@ # author: NinEveN # date: 2022/1/6 from rest_framework.pagination import PageNumberPagination - from rest_framework.viewsets import ModelViewSet from common.core.response import ApiResponse diff --git a/fir_ser/api/views/login_wx.py b/fir_ser/api/views/login_wx.py index 8209efa..b0fd027 100644 --- a/fir_ser/api/views/login_wx.py +++ b/fir_ser/api/views/login_wx.py @@ -86,7 +86,7 @@ class WeChatLoginCheckView(APIView): if not Config.LOGIN.get("login_type").get('third', '').get('wxp'): return Response(ret.dict) 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: 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) diff --git a/fir_ser/api/views/order.py b/fir_ser/api/views/order.py index 827bc99..d80cbb6 100644 --- a/fir_ser/api/views/order.py +++ b/fir_ser/api/views/order.py @@ -134,7 +134,7 @@ class OrderSyncView(APIView): def post(self, request): res = BaseResponse() 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: 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) diff --git a/fir_ser/xsign/views/receiveudids.py b/fir_ser/xsign/views/receiveudids.py index dd042c1..ab4e882 100644 --- a/fir_ser/xsign/views/receiveudids.py +++ b/fir_ser/xsign/views/receiveudids.py @@ -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.cache.storage import TaskStateCache 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.pending import get_pending_result from fir_ser.celery import app @@ -104,6 +104,7 @@ def task_func(task_id, *args, **kwargs): class TaskView(APIView): + throttle_classes = [VisitShortThrottle, InstallShortThrottle] def get(self, request, short): res = BaseResponse()