新设备

This commit is contained in:
wuaho 2021-11-23 11:22:36 +08:00
parent 5df64d9db9
commit c11f4569f6

View File

@ -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'