Merge branch 'dev_aliyun' into dev_tj

merge aliyun
dev_new_shixunsrepository
tangjiang 5 years ago
commit 17ca49e99c

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

@ -282,10 +282,10 @@ class ApplicationController < ActionController::Base
end
def user_setup
# reacct静态资源加载不需要走这一步
# # reacct静态资源加载不需要走这一步
return if params[:controller] == "main"
# 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
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!
after_action :rebind_event_if_ajax_render_partial
skip_before_action :check_sign
helper_method :current_laboratory, :current_setting_or_default

@ -44,12 +44,13 @@ class HacksController < ApplicationController
begin
logger.info("##########{hack_params}")
hack = Hack.new(hack_params)
hack.user_id = current_user.id
hack.identifier = generate_identifier Hack, 8
ActiveRecord::Base.transaction do
hack.user_id = current_user.id
hack.identifier = generate_identifier Hack, 8
hack.save!
# 创建测试集与代码
hack.hack_sets.create!(hack_sets_params)
# 新建知识点
hack_codes = hack.hack_codes.new(hack_code_params)
hack_codes.modify_time = Time.now
hack_codes.save!

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

@ -2,7 +2,7 @@
<nav id="sidebar" class="<%= sidebar_collapse ? 'active' : '' %>" data-current-controller="<%= admin_sidebar_controller %>">
<div class="sidebar-header">
<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>
</a>
<div id="sidebarCollapse" class="navbar-btn <%= sidebar_collapse ? 'active' : '' %>">

@ -158,6 +158,17 @@
<!-- 在tpi js里加载这3个脚本 -->
<script>
(function() {
if (window.history && window.history.pushState) {
$(window).on('popstate', function () {
window.history.pushState('forward', null, '#');
window.history.forward(1);
window.location.href = window.location.reload();
});
}
window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
window.history.forward(1);
})();
(function() { // Scoping function to avoid globals
var href = location.href;
if(window.location.port === "3007"){

@ -10,6 +10,7 @@ const $ = window.$;
const opens ="79e33abd4b6588941ab7622aed1e67e8";
let timestamp;
let checkSubmitFlg = false;
broadcastChannelOnmessage('refreshPage', () => {
window.location.reload()
})
@ -51,7 +52,7 @@ if (isDev) {
checkSubmitFlg=true
window.setTimeout(function () {
checkSubmitFlg=false;
}, 2500);
}, 2000);
}else if(checkSubmitFlg===false){
$.ajax({url:proxy,async:false,success:function(data){
if(data.status===0){
@ -61,7 +62,7 @@ if (isDev) {
checkSubmitFlg=true
window.setTimeout(function () {
checkSubmitFlg=false;
}, 2500);
}, 2000);
}
}
window._debugType = debugType;
@ -227,8 +228,12 @@ export function initAxiosInterceptors(props) {
}
if (response.data.status === 501) {
notification.warning({
notification.open({
message:"提示",
description:response.data.message || '访问异常,请求不合理',
style: {
zIndex: 99999999
}
})
}

Loading…
Cancel
Save