寻息接口优化
This commit is contained in:
parent
b38b76ef81
commit
6f78d5dc0a
|
@ -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])
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue