mirror of https://github.com/jumpserver/jumpserver
[Update] 修改切换组织后页面跳转 (#3715)
parent
8b8b11ce1e
commit
98bb6c63f5
|
@ -193,6 +193,7 @@ class Config(dict):
|
|||
'FORCE_SCRIPT_NAME': '',
|
||||
'LOGIN_CONFIRM_ENABLE': False,
|
||||
'WINDOWS_SKIP_ALL_MANUAL_PASSWORD': False,
|
||||
'ORG_CHANGE_TO_URL': ''
|
||||
}
|
||||
|
||||
def convert_type(self, k, v):
|
||||
|
|
|
@ -82,3 +82,4 @@ USER_GUIDE_URL = DYNAMIC.USER_GUIDE_URL
|
|||
HTTP_LISTEN_PORT = CONFIG.HTTP_LISTEN_PORT
|
||||
WS_LISTEN_PORT = CONFIG.WS_LISTEN_PORT
|
||||
LOGIN_LOG_KEEP_DAYS = DYNAMIC.LOGIN_LOG_KEEP_DAYS
|
||||
ORG_CHANGE_TO_URL = CONFIG.ORG_CHANGE_TO_URL
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
from django.shortcuts import redirect, reverse
|
||||
from django.conf import settings
|
||||
from django.http import HttpResponseForbidden
|
||||
|
||||
from django.views.generic import DetailView, View
|
||||
|
@ -16,6 +17,9 @@ class SwitchOrgView(DetailView):
|
|||
self.object = Organization.get_instance(pk)
|
||||
oid = str(self.object.id)
|
||||
request.session['oid'] = oid
|
||||
org_change_to_url = settings.ORG_CHANGE_TO_URL
|
||||
if org_change_to_url:
|
||||
return redirect(org_change_to_url)
|
||||
host = request.get_host()
|
||||
referer = request.META.get('HTTP_REFERER', '')
|
||||
if referer.find(host) == -1:
|
||||
|
|
Loading…
Reference in New Issue