|
@@ -19,6 +19,7 @@ async def verify_super_admin(token: str = Depends(reuseable_oauth)) -> schemas.T
|
|
|
if token_data.role_id != 1:
|
|
|
raise Exception("暂无权限")
|
|
|
g.user_id = token_data.user_id
|
|
|
+ g.user_name = token_data.user_name
|
|
|
g.project_id = token_data.project_id
|
|
|
return token_data
|
|
|
|
|
@@ -30,6 +31,7 @@ async def verify_special(token: str = Depends(reuseable_oauth)) -> schemas.Token
|
|
|
if not token_data.role_id in [1,3]:
|
|
|
raise Exception("暂无权限")
|
|
|
g.user_id = token_data.user_id
|
|
|
+ g.user_name = token_data.user_name
|
|
|
g.project_id = token_data.project_id
|
|
|
return token_data
|
|
|
|
|
@@ -39,5 +41,6 @@ async def verify_users(token: str = Depends(reuseable_oauth)) -> schemas.TokenDa
|
|
|
token_data_dict = json.loads(token_data_str)
|
|
|
token_data = schemas.TokenData(**token_data_dict)
|
|
|
g.user_id = token_data.user_id
|
|
|
+ g.user_name = token_data.user_name
|
|
|
g.project_id = token_data.project_id
|
|
|
return token_data
|