mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-21 20:25:45 +08:00
FIX admin
This commit is contained in:
@@ -14,6 +14,7 @@ class Admins::BaseController < ApplicationController
|
||||
private
|
||||
|
||||
def require_login
|
||||
User.current = User.find 1
|
||||
return if User.current.logged?
|
||||
|
||||
redirect_to "/login?back_url=#{CGI::escape(request.fullpath)}"
|
||||
@@ -42,4 +43,4 @@ class Admins::BaseController < ApplicationController
|
||||
def setup_laboratory
|
||||
Laboratory.current = Laboratory.find_by_subdomain(request.subdomain) || Laboratory.find(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ class Admins::LaboratoriesController < Admins::BaseController
|
||||
default_sort('id', 'desc')
|
||||
|
||||
laboratories = Admins::LaboratoryQuery.call(params)
|
||||
@laboratories = paginate laboratories.preload(:school, :laboratory_users)
|
||||
@laboratories = paginate laboratories.preload(:laboratory_users)
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -82,4 +82,4 @@ class Admins::LaboratoriesController < Admins::BaseController
|
||||
def setting_params
|
||||
params.permit(:sync_course, :sync_subject, :sync_shixun)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user