Skip to content

Commit

Permalink
Support docs url prefix (#1365)
Browse files Browse the repository at this point in the history
  • Loading branch information
nannan00 authored Nov 4, 2023
1 parent 69c4622 commit e6253a2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/login/bklogin/bkauth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _bk_login(request):
"is_plain": request.path_info == "/plain/",
}

# NOTE: account/login.html 为支持自适应大小的模板
# NOTE: login.html 为支持自适应大小的模板
response = TemplateResponse(request, "login.html", context)
response = set_bk_token_invalid(request, response)
return response
Expand Down
4 changes: 2 additions & 2 deletions src/login/bklogin/ee_login/settings_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
###########################
# 自定义登录 custom_login #
###########################
# 配置自定义登录请求和登录回调的响应函数, 如:CUSTOM_LOGIN_VIEW = 'ee_official_login.oauth.google.views.login'
# 配置自定义登录请求和登录回调的响应函数, 如:CUSTOM_LOGIN_VIEW = 'bklogin.ee_official_login.oauth.google.views.login'
CUSTOM_LOGIN_VIEW = ""
# 配置自定义验证是否登录的认证函数, 如:CUSTOM_AUTHENTICATION_BACKEND = 'ee_official_login.oauth.google.backends.OauthBackend'
# 配置自定义验证是否登录的认证函数, 如:CUSTOM_AUTHENTICATION_BACKEND = 'bklogin.ee_official_login.oauth.google.backends.OauthBackend'
CUSTOM_AUTHENTICATION_BACKEND = ""
8 changes: 4 additions & 4 deletions src/login/bklogin/ee_login/settings_login_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
###########################
# 自定义登录 custom_login #
###########################
# 配置自定义登录请求和登录回调的响应函数, 如:CUSTOM_LOGIN_VIEW = 'ee_official_login.oauth.google.views.login'
CUSTOM_LOGIN_VIEW = "ee_official_login.mock.views.login"
# 配置自定义验证是否登录的认证函数, 如:CUSTOM_AUTHENTICATION_BACKEND = 'ee_official_login.oauth.google.backends.OauthBackend'
CUSTOM_AUTHENTICATION_BACKEND = "ee_official_login.mock.backends.MockBackend"
# 配置自定义登录请求和登录回调的响应函数, 如:CUSTOM_LOGIN_VIEW = 'bklogin.ee_official_login.oauth.google.views.login'
CUSTOM_LOGIN_VIEW = "bklogin.ee_official_login.mock.views.login"
# 配置自定义验证是否登录的认证函数, 如:CUSTOM_AUTHENTICATION_BACKEND = 'bklogin.ee_official_login.oauth.google.backends.OauthBackend'
CUSTOM_AUTHENTICATION_BACKEND = "bklogin.ee_official_login.mock.backends.MockBackend"
8 changes: 4 additions & 4 deletions src/login/bklogin/ee_login/settings_login_oauth_google.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
###########################
# 自定义登录 custom_login #
###########################
# 配置自定义登录请求和登录回调的响应函数, 如:CUSTOM_LOGIN_VIEW = 'ee_official_login.oauth.google.views.login'
CUSTOM_LOGIN_VIEW = "ee_official_login.oauth.google.views.login"
# 配置自定义验证是否登录的认证函数, 如:CUSTOM_AUTHENTICATION_BACKEND = 'ee_official_login.oauth.google.backends.OauthBackend'
CUSTOM_AUTHENTICATION_BACKEND = "ee_official_login.oauth.google.backends.OauthBackend"
# 配置自定义登录请求和登录回调的响应函数, 如:CUSTOM_LOGIN_VIEW = 'bklogin.ee_official_login.oauth.google.views.login'
CUSTOM_LOGIN_VIEW = "bklogin.ee_official_login.oauth.google.views.login"
# 配置自定义验证是否登录的认证函数, 如:CUSTOM_AUTHENTICATION_BACKEND = 'bklogin.ee_official_login.oauth.google.backends.OauthBackend'
CUSTOM_AUTHENTICATION_BACKEND = "bklogin.ee_official_login.oauth.google.backends.OauthBackend"
2 changes: 1 addition & 1 deletion src/login/bklogin/ee_official_login/mock/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def login(request):
"login_redirect_to": "",
}

template_name = "account/login.html"
template_name = "login.html"
response = TemplateResponse(request, template_name, context)
response = set_bk_token_invalid(request, response)
return response
4 changes: 2 additions & 2 deletions src/saas/bkuser_shell/config/common/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
###################
# Footer & Header #
###################
BK_DOC_URL = "https://bk.tencent.com/docs/markdown/用户管理/产品白皮书/产品简介/README.md"

BK_DOCS_URL_PREFIX = env("BK_DOCS_URL_PREFIX", 'https://bk.tencent.com/docs')
BK_DOC_URL = f"{BK_DOCS_URL_PREFIX}/markdown/ZH/UserManage/2.5/UserGuide/Introduce/README.md"

# ==============================================================================
# Proxy http connections
Expand Down

0 comments on commit e6253a2

Please sign in to comment.