寻息接口优化

This commit is contained in:
caoqianming 2022-04-11 14:55:46 +08:00
parent b38b76ef81
commit 6f78d5dc0a
2 changed files with 4 additions and 4 deletions

View File

@ -95,7 +95,7 @@ class XxCommonViewSet(CreateModelMixin, CustomGenericViewSet):
url=vdata['url'],
method=vdata.get('method', 'post'),
params=vdata.get('params', {}),
json=vdata.get('data', {}))
json=vdata.get('json', {}))
return Response(res)
@action(methods=['get'], detail=False, permission_classes=[IsAuthenticated])
@ -128,7 +128,7 @@ class DhCommonViewSet(CreateModelMixin, CustomGenericViewSet):
url=vdata['url'],
method=vdata.get('method', 'post'),
params=vdata.get('params', {}),
json=vdata.get('data', {}))
json=vdata.get('json', {}))
return Response(res)
@action(methods=['get'], detail=False, permission_classes=[IsAuthenticated])

View File

@ -74,8 +74,8 @@ class XxClient:
else:
r = getattr(requests, method)('{}{}'.format(settings.XX_BASE_URL, url)
, params=params, json=json, verify=False)
if settings.DEBUG:
print_roundtrip(r)
# if settings.DEBUG:
# print_roundtrip(r)
ret = r.json()
if ret.get('errorCode') == '1060000':
self.get_token() # 重新获取token