Skip to content

Commit

Permalink
fix(backend): 请求用户默认从params取(兼容SCR授权) TencentBlueKing#7197
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud committed Sep 30, 2024
1 parent 5a5af3d commit fce8454
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dbm-ui/backend/components/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,7 @@ def _set_session_headers(self, session, local_request, headers: Dict, params: Di
bkapi_auth_headers = {
"bk_app_code": params.pop("bk_app_code", env.APP_CODE),
"bk_app_secret": params.pop("bk_app_secret", env.SECRET_KEY),
# 如果既不是use_admin,也非local_request请求,则用户先置为空
"bk_username": "",
"bk_username": params.pop("bk_username", "Anonymous"),
}
if use_admin or self.is_backend_request():
# 使用管理员/平台身份调用接口
Expand Down

0 comments on commit fce8454

Please sign in to comment.