Commit 6e0532a6 authored by ZZH's avatar ZZH

shidianu opendata open auth 2024-07-10

parent e7b124f8
......@@ -108,24 +108,23 @@ async def stb_data_longgang_service(user_id, d_type):
async def get_power(user_id, cids):
user_info = await get_user_product_auth(user_id)
if isinstance(cids, list):
if user_info and user_info.get("cid_ext"):
cid_ext = json.loads(user_info["cid_ext"])
for cid in cids:
user_cid_power = cid_ext.get(str(cid), "")
if not user_cid_power or (4 not in user_cid_power):
return False
return True
return False
elif isinstance(cids, int):
if user_info and user_info.get("cid_ext"):
cid_ext = json.loads(user_info["cid_ext"])
user_cid_power = cid_ext.get(str(cids), "")
if user_cid_power and (4 in user_cid_power):
return True
return False
# user_info = await get_user_product_auth(user_id)
# if isinstance(cids, list):
# if user_info and user_info.get("cid_ext"):
# cid_ext = json.loads(user_info["cid_ext"])
# for cid in cids:
# user_cid_power = cid_ext.get(str(cid), "")
# if not user_cid_power or (4 not in user_cid_power):
# return False
# return True
# return False
# elif isinstance(cids, int):
# if user_info and user_info.get("cid_ext"):
# cid_ext = json.loads(user_info["cid_ext"])
# user_cid_power = cid_ext.get(str(cids), "")
# if user_cid_power and (4 in user_cid_power):
# return True
# return False
def get_token():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment