Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
U
unify_api2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chaonan
unify_api2
Commits
6e0532a6
Commit
6e0532a6
authored
Jul 10, 2024
by
ZZH
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shidianu opendata open auth 2024-07-10
parent
e7b124f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
open_data_service.py
unify_api/modules/shidianu/service/open_data_service.py
+17
-18
No files found.
unify_api/modules/shidianu/service/open_data_service.py
View file @
6e0532a6
...
...
@@ -108,24 +108,23 @@ async def stb_data_longgang_service(user_id, d_type):
async
def
get_power
(
user_id
,
cids
):
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
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
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment