标记角色编号

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
async def role_idx(request, rdb, data):
"""
标记新设备
标记角色编号
:param request:
:param rdb:
:param data:
: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
binduid = data.get("properties", {}).get("binduid")
account = data.get("properties", {}).get("account")
account_id = data.get("#account_id")
if binduid and account_id:
key = f'{data["#app_id"]}_{binduid}_roles'
if account and account_id:
key = f'{data["#app_id"]}_{account}_roles'
v = await rdb.execute('sadd', key, account_id)
# 新角色 编号
if v == 1: