diff --git a/app/controllers/admins/base_controller.rb b/app/controllers/admins/base_controller.rb index ad56afbf7..f90c8a1ed 100644 --- a/app/controllers/admins/base_controller.rb +++ b/app/controllers/admins/base_controller.rb @@ -6,7 +6,6 @@ class Admins::BaseController < ApplicationController layout 'admin' skip_before_action :verify_authenticity_token - skip_before_action :setup_laboratory before_action :require_login, :require_admin! @@ -38,4 +37,9 @@ class Admins::BaseController < ApplicationController append_js = ERB.new(File.open(path).read).result response.body += append_js end + + # 重写此方法,防止影响超级管理员端云上实验室功能,因为那里重写了:current_laboratory方法 + def setup_laboratory + Laboratory.current = Laboratory.find_by_subdomain(request.subdomain) || Laboratory.find(1) + end end \ No newline at end of file diff --git a/app/views/settings/show.json.jbuilder b/app/views/settings/show.json.jbuilder index a43544b23..e21e9fa48 100644 --- a/app/views/settings/show.json.jbuilder +++ b/app/views/settings/show.json.jbuilder @@ -14,4 +14,6 @@ json.setting do json.navbar setting.navbar || default_setting.navbar json.footer setting.footer || default_setting.footer + + json.main_site current_laboratory.main_site? end \ No newline at end of file diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js index 8cf99a793..123b2f2a0 100644 --- a/public/react/src/modules/login/EducoderLogin.js +++ b/public/react/src/modules/login/EducoderLogin.js @@ -196,13 +196,30 @@ class EducoderLogin extends Component { } -
-
© 2019 EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
-
+ {this.props.mygetHelmetapi === null ?
+
© 2019 EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
+
: + this.props.mygetHelmetapi===undefined||this.props.mygetHelmetapi.main_site===null|| this.props.mygetHelmetapi.main_site===undefined?
+
© 2019 EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
+
:this.props.mygetHelmetapi.main_site===true? +
+
© 2019 EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
+
+ :"" + } + ) @@ -221,4 +238,4 @@ export default EducoderLogin ; // // // -// : \ No newline at end of file +// :