|
|
|
@ -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
|