Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_item_bank

dev_jupyter
杨树林 5 years ago
commit c354c15f34

@ -6,7 +6,6 @@ class Admins::BaseController < ApplicationController
layout 'admin' layout 'admin'
skip_before_action :verify_authenticity_token skip_before_action :verify_authenticity_token
before_action :require_login, :require_admin! before_action :require_login, :require_admin!
after_action :rebind_event_if_ajax_render_partial after_action :rebind_event_if_ajax_render_partial

@ -282,10 +282,10 @@ class ApplicationController < ActionController::Base
end end
def user_setup def user_setup
# reacct静态资源加载不需要走这一步 # # reacct静态资源加载不需要走这一步
return if params[:controller] == "main" return if params[:controller] == "main"
# Find the current user # Find the current user
Rails.logger.info("current_laboratory is #{current_laboratory} domain is #{request.subdomain}") #Rails.logger.info("current_laboratory is #{current_laboratory} domain is #{request.subdomain}")
User.current = find_current_user User.current = find_current_user
uid_logger("user_setup: " + (User.current.logged? ? "#{User.current.try(:login)} (id=#{User.current.try(:id)})" : "anonymous")) uid_logger("user_setup: " + (User.current.logged? ? "#{User.current.try(:login)} (id=#{User.current.try(:id)})" : "anonymous"))

@ -10,6 +10,7 @@ class Cooperative::BaseController < ApplicationController
before_action :laboratory_exist!, :require_login, :require_cooperative_manager! before_action :laboratory_exist!, :require_login, :require_cooperative_manager!
after_action :rebind_event_if_ajax_render_partial after_action :rebind_event_if_ajax_render_partial
skip_before_action :check_sign
helper_method :current_laboratory, :current_setting_or_default helper_method :current_laboratory, :current_setting_or_default

@ -15,7 +15,6 @@ class SchoolsController < ApplicationController
schools = School.all schools = School.all
keyword = params[:keyword].to_s.strip keyword = params[:keyword].to_s.strip
schools = schools.where('name LIKE ?', "%#{keyword}%") if keyword schools = schools.where('name LIKE ?', "%#{keyword}%") if keyword
render_ok(schools: schools.select(:id, :name).as_json) render_ok(schools: schools.select(:id, :name).as_json)
end end

@ -2,7 +2,7 @@
<nav id="sidebar" class="<%= sidebar_collapse ? 'active' : '' %>" data-current-controller="<%= admin_sidebar_controller %>"> <nav id="sidebar" class="<%= sidebar_collapse ? 'active' : '' %>" data-current-controller="<%= admin_sidebar_controller %>">
<div class="sidebar-header"> <div class="sidebar-header">
<a href="/" class="sidebar-header-logo" data-toggle="tooltip" data-title="返回主站" > <a href="/" class="sidebar-header-logo" data-toggle="tooltip" data-title="返回主站" >
<img class="rounded-circle" src="/images/<%= url_to_avatar(current_user) %>" /> <!-- <img class="rounded-circle" src="/images/<%#= url_to_avatar(current_user) %>" />-->
<span class="logo-label">后台管理</span> <span class="logo-label">后台管理</span>
</a> </a>
<div id="sidebarCollapse" class="navbar-btn <%= sidebar_collapse ? 'active' : '' %>"> <div id="sidebarCollapse" class="navbar-btn <%= sidebar_collapse ? 'active' : '' %>">

@ -51,7 +51,7 @@ if (isDev) {
checkSubmitFlg=true checkSubmitFlg=true
window.setTimeout(function () { window.setTimeout(function () {
checkSubmitFlg=false; checkSubmitFlg=false;
}, 2500); }, 2000);
}else if(checkSubmitFlg===false){ }else if(checkSubmitFlg===false){
$.ajax({url:proxy,async:false,success:function(data){ $.ajax({url:proxy,async:false,success:function(data){
if(data.status===0){ if(data.status===0){
@ -61,7 +61,7 @@ if (isDev) {
checkSubmitFlg=true checkSubmitFlg=true
window.setTimeout(function () { window.setTimeout(function () {
checkSubmitFlg=false; checkSubmitFlg=false;
}, 2500); }, 2000);
} }
} }
window._debugType = debugType; window._debugType = debugType;
@ -224,6 +224,7 @@ export function initAxiosInterceptors(props) {
} }
if (response.data.status === 501) { if (response.data.status === 501) {
window.location.reload()
notification.warning({ notification.warning({
description:response.data.message || '访问异常,请求不合理', description:response.data.message || '访问异常,请求不合理',
}) })

Loading…
Cancel
Save