标记角色编号

This commit is contained in:
wuaho 2021-04-16 20:33:58 +08:00
parent ac853d4c3d
commit 893a129c59

View File

@ -94,20 +94,20 @@ async def order_idx(request, rdb, data):
@TaHandler @TaHandler
async def role_idx(request, rdb, data): async def role_idx(request, rdb, data):
""" """
标记新设备 标记角色编号
:param request: :param request:
:param rdb: :param rdb:
:param data: :param data:
:return: :return:
""" """
# 条件 # 条件
if data.get('#type') == 'user' and data.get('#event_name') == 'setOnce': if data.get('#type') == 'track' and data.get('#event_name') == 'create_role':
# key = $appid.$binduid v : uid # key = $appid.$binduid v : uid
binduid = data.get("properties", {}).get("binduid") account = data.get("properties", {}).get("account")
account_id = data.get("#account_id") account_id = data.get("#account_id")
if binduid and account_id: if account and account_id:
key = f'{data["#app_id"]}_{binduid}_roles' key = f'{data["#app_id"]}_{account}_roles'
v = await rdb.execute('sadd', key, account_id) v = await rdb.execute('sadd', key, account_id)
# 新角色 编号 # 新角色 编号
if v == 1: if v == 1: