|
@@ -43,16 +43,19 @@ class NotificationView(View):
|
|
|
n_time = request_dict.get('n_time', None)
|
|
|
event_type = request_dict.get('event_type', None)
|
|
|
is_st = request_dict.get('is_st', None)
|
|
|
+ uid = request_dict.get('uid', None)
|
|
|
if not all([channel, n_time]):
|
|
|
return JsonResponse(status=200, data={'code': 444, 'msg': 'error channel or n_time'})
|
|
|
try:
|
|
|
- uid = DevicePushService.decode_uid(etk, uidToken) # 解密uid
|
|
|
+ if not uid:
|
|
|
+ uid = DevicePushService.decode_uid(etk, uidToken) # 解密uid
|
|
|
if len(uid) != 20 and len(uid) != 14:
|
|
|
return JsonResponse(status=200, data={'code': 404, 'msg': 'wrong uid'})
|
|
|
logger.info("旧移动侦测接口的uid:{}".format(uid))
|
|
|
+ event_type = int(event_type)
|
|
|
pkey = '{uid}_{channel}_{event_type}_ptl'.format(uid=uid, event_type=event_type, channel=channel)
|
|
|
ykey = '{uid}_redis_qs'.format(uid=uid)
|
|
|
- is_sys_msg = self.is_sys_msg(int(event_type))
|
|
|
+ is_sys_msg = self.is_sys_msg(event_type)
|
|
|
if is_sys_msg is True:
|
|
|
dkey = '{uid}_{channel}_{event_type}_flag'.format(uid=uid, event_type=event_type, channel=channel)
|
|
|
else:
|
|
@@ -66,9 +69,10 @@ class NotificationView(View):
|
|
|
# 一分钟外,推送开启状态
|
|
|
detect_med_type = 0 # 0推送旧机制 1存库不推送,2推送存库
|
|
|
# 暂时注销
|
|
|
- if have_pkey:
|
|
|
- res_data = {'code': 0, 'msg': 'Push it once a minute'}
|
|
|
- return JsonResponse(status=200, data=res_data)
|
|
|
+ if event_type != 606:
|
|
|
+ if have_pkey:
|
|
|
+ res_data = {'code': 0, 'msg': 'Push it once a minute'}
|
|
|
+ return JsonResponse(status=200, data=res_data)
|
|
|
|
|
|
# 数据库读取数据
|
|
|
if have_ykey:
|