diff --git a/dbm-ui/backend/components/base.py b/dbm-ui/backend/components/base.py index a49dd91a67..2598fb6a08 100644 --- a/dbm-ui/backend/components/base.py +++ b/dbm-ui/backend/components/base.py @@ -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(): # 使用管理员/平台身份调用接口