diff --git a/apps/utils/decorators.py b/apps/utils/decorators.py index fb2e01cb..6fd9f826 100644 --- a/apps/utils/decorators.py +++ b/apps/utils/decorators.py @@ -6,6 +6,7 @@ import hashlib import json from django.core.cache import cache from rest_framework.exceptions import ParseError +from rest_framework.response import Response myLogger = logging.getLogger('log') @@ -48,6 +49,6 @@ def idempotent(seconds=4): return real_func elif hash_v_e == 'o': # 说明请求正在处理 raise ParseError(f'请求忽略,请{seconds}秒后重试') - return hash_v_e + return Response(hash_v_e) return wrapper return decorate