From c11f4569f69cdd9bb3793be0ce2d02327def686c Mon Sep 17 00:00:00 2001 From: wuaho Date: Tue, 23 Nov 2021 11:22:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler_data/ta_handler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/handler_data/ta_handler.py b/handler_data/ta_handler.py index 37f14c9..889337a 100644 --- a/handler_data/ta_handler.py +++ b/handler_data/ta_handler.py @@ -113,6 +113,11 @@ async def role_idx(request, rdb, data): # 新角色 编号 if v == 1: data['properties']['role_idx'] = await rdb.execute('scard', key) + device_key = f'{data["#app_id"]}_{distinct_id}' + res = await rdb.execute('set', device_key, 1,'Nx') + if res == b'OK': + data['properties']['is_new_device'] = 1 + # sadd O(n) # if distinct_id: # key = f'{data["#app_id"]}_devices'