|
@@ -157,10 +157,12 @@ class AppToAppView(View):
|
|
# 连接状态为1,通过api获取状态
|
|
# 连接状态为1,通过api获取状态
|
|
if link_status == 1:
|
|
if link_status == 1:
|
|
request_method = 'get'
|
|
request_method = 'get'
|
|
- r = cls.refresh_access_token(user_id, request_method)
|
|
|
|
- if r is None:
|
|
|
|
- return response.json(173)
|
|
|
|
- res_data = eval(r.content)
|
|
|
|
|
|
+ try:
|
|
|
|
+ r = cls.refresh_access_token(user_id, request_method)
|
|
|
|
+ except AssertionError:
|
|
|
|
+ alexa_oauth_qs.update(link_status=0)
|
|
|
|
+ else:
|
|
|
|
+ res_data = eval(r.content)
|
|
return response.json(0, res_data)
|
|
return response.json(0, res_data)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|