|
@@ -15,7 +15,6 @@ import base64
|
|
|
import datetime
|
|
|
import logging
|
|
|
import random
|
|
|
-import threading
|
|
|
import time
|
|
|
import traceback
|
|
|
from io import BytesIO
|
|
@@ -2209,6 +2208,7 @@ class InitInfoView(View):
|
|
|
return response.json(904)
|
|
|
else:
|
|
|
return response.json(444, 'push_type')
|
|
|
+ self.save_push_config(userID, appBundleId, push_type, token_val, m_code, lang, tz)
|
|
|
if m_code:
|
|
|
# 获取设备推送状态
|
|
|
update_dict = {
|
|
@@ -2269,14 +2269,14 @@ class InitInfoView(View):
|
|
|
app_type = 1 if push_type == 0 else 2
|
|
|
gateway_push_qs = GatewayPush.objects.filter(user_id=user_id, m_code=m_code)
|
|
|
if gateway_push_qs.exists():
|
|
|
- gateway_push_qs.update(token_val=token_val, logout=False)
|
|
|
+ if gateway_push_qs.first().token_val != token_val:
|
|
|
+ gateway_push_qs.update(token_val=token_val, logout=False)
|
|
|
else:
|
|
|
GatewayPush.objects.create(user_id=user_id, app_bundle_id=app_bundle_id, app_type=app_type,
|
|
|
push_type=push_type, token_val=token_val, m_code=m_code, lang=lang, tz=tz)
|
|
|
except Exception as e:
|
|
|
print('出错了~异步保存配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
-
|
|
|
def update_country(self, request_dict, response, request):
|
|
|
username = request_dict.get('unique', None)
|
|
|
appBundleId = request_dict.get('appBundleId', None)
|