|
@@ -2319,6 +2319,7 @@ class InitInfoView(View):
|
|
def init_info(self, request_dict, userID, response, request):
|
|
def init_info(self, request_dict, userID, response, request):
|
|
# 未读的系统消息
|
|
# 未读的系统消息
|
|
token_val = request_dict.get('token_val', None)
|
|
token_val = request_dict.get('token_val', None)
|
|
|
|
+ jg_token_val = request_dict.get('jg_token_val', '')
|
|
m_code = request_dict.get('m_code', None)
|
|
m_code = request_dict.get('m_code', None)
|
|
push_type = request_dict.get('push_type', None)
|
|
push_type = request_dict.get('push_type', None)
|
|
appBundleId = request_dict.get('appBundleId', None)
|
|
appBundleId = request_dict.get('appBundleId', None)
|
|
@@ -2329,7 +2330,8 @@ class InitInfoView(View):
|
|
m_code = m_code[4:]
|
|
m_code = m_code[4:]
|
|
if all([token_val, push_type, appBundleId, userID]):
|
|
if all([token_val, push_type, appBundleId, userID]):
|
|
self.save_push_config(userID, appBundleId, push_type, token_val, m_code, lang, tz)
|
|
self.save_push_config(userID, appBundleId, push_type, token_val, m_code, lang, tz)
|
|
- self.save_or_creat_uid_push(userID, appBundleId, push_type, token_val, m_code, lang, tz, now_time)
|
|
|
|
|
|
+ self.save_or_creat_uid_push(userID, appBundleId, push_type, token_val, m_code, lang, tz, now_time,
|
|
|
|
+ jg_token_val)
|
|
if appBundleId:
|
|
if appBundleId:
|
|
user_ex_qs = UserExModel.objects.filter(userID_id=userID)
|
|
user_ex_qs = UserExModel.objects.filter(userID_id=userID)
|
|
user_ex = None
|
|
user_ex = None
|
|
@@ -2392,13 +2394,14 @@ class InitInfoView(View):
|
|
print('出错了~异步保存配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
print('出错了~异步保存配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
- def save_or_creat_uid_push(user_id, app_bundle_id, push_type, token_val, m_code, lang, tz, now_time):
|
|
|
|
|
|
+ def save_or_creat_uid_push(user_id, app_bundle_id, push_type, token_val, m_code, lang, tz, now_time, jg_token_val):
|
|
"""
|
|
"""
|
|
异步保存推送配置
|
|
异步保存推送配置
|
|
@param user_id: 用户id
|
|
@param user_id: 用户id
|
|
@param app_bundle_id: app版本包id
|
|
@param app_bundle_id: app版本包id
|
|
@param push_type: 推送类型 0:Ios,1:Google,2:国内极光
|
|
@param push_type: 推送类型 0:Ios,1:Google,2:国内极光
|
|
@param token_val: 推送token
|
|
@param token_val: 推送token
|
|
|
|
+ @param jg_token_val: 极光推送token
|
|
@param m_code: 手机唯一标识
|
|
@param m_code: 手机唯一标识
|
|
@param lang: 语言
|
|
@param lang: 语言
|
|
@param tz: 时区
|
|
@param tz: 时区
|
|
@@ -2413,12 +2416,12 @@ class InitInfoView(View):
|
|
for item in uid_set:
|
|
for item in uid_set:
|
|
uid_push_qs = UidPushModel.objects.filter(userID=user_id, m_code=m_code, uid_set_id=item['id'])
|
|
uid_push_qs = UidPushModel.objects.filter(userID=user_id, m_code=m_code, uid_set_id=item['id'])
|
|
if uid_push_qs.exists():
|
|
if uid_push_qs.exists():
|
|
- if uid_push_qs.first().token_val != token_val:
|
|
|
|
- uid_push_qs.update(token_val=token_val, push_type=push_type)
|
|
|
|
|
|
+ uid_push_qs.update(token_val=token_val, push_type=push_type, jg_token_val=jg_token_val)
|
|
else:
|
|
else:
|
|
UidPushModel.objects.create(userID_id=user_id, appBundleId=app_bundle_id, app_type=app_type,
|
|
UidPushModel.objects.create(userID_id=user_id, appBundleId=app_bundle_id, app_type=app_type,
|
|
push_type=push_type, token_val=token_val, m_code=m_code, lang=lang,
|
|
push_type=push_type, token_val=token_val, m_code=m_code, lang=lang,
|
|
- tz=tz, addTime=now_time, updTime=now_time, uid_set_id=item['id'])
|
|
|
|
|
|
+ tz=tz, addTime=now_time, updTime=now_time, uid_set_id=item['id'],
|
|
|
|
+ jg_token_val=jg_token_val)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
LOGGER.info('出错了~保存推送配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
LOGGER.info('出错了~保存推送配置信息错误,errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|