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

chromesetting
cxt 5 years ago
commit f69b1fd011

@ -60,7 +60,8 @@ class AccountsController < ApplicationController
ua = UserAgent.find_by_ip(ip)
ua.update_column(:agent_type, UserAgent::USER_REGISTER) if ua
successful_authentication(@user)
session[:user_id] = @user.id
# session[:user_id] = @user.id
session[:"#{default_yun_session}"] = @user.id
normal_status("注册成功")
end
rescue Exception => e
@ -94,7 +95,7 @@ class AccountsController < ApplicationController
successful_authentication(@user)
login_control.clear # 重置每日密码错误次数
session[:user_id] = @user.id
# session[:user_id] = @user.id
end
# 忘记密码
@ -158,7 +159,7 @@ class AccountsController < ApplicationController
def logout
UserAction.create(action_id: User.current.id, action_type: "Logout", user_id: User.current.id, :ip => request.remote_ip)
session[:user_id] = nil
session[:"#{default_yun_session}"] = nil
logout_user
render :json => {status: 1, message: "退出成功!"}
end

@ -0,0 +1,14 @@
class Admins::ShixunFeedbackMessagesController < Admins::BaseController
def index
default_sort('created_at', 'desc')
@params_page = params[:page] || 1
if params[:keyword]
discusses = Discuss.find_by_sql("select * from discusses join shixuns on discusses.dis_id = shixuns.id where discusses.dis_type='Shixun' AND
shixuns.name like '%#{params[:keyword]}%'")
else
discusses = Discuss.where(:dis_type => 'Shixun').includes(:user, :dis)
end
@discusses = paginate discusses
end
end

@ -299,9 +299,11 @@ class ApplicationController < ActionController::Base
# and starts a session if needed
def find_current_user
uid_logger("user setup start: session[:user_id] is #{session[:user_id]}")
if session[:user_id]
uid_logger("0000000000000user setup start: session[:user_id] is #{session[:"#{default_yun_session}"]}")
current_domain_session = session[:"#{default_yun_session}"]
if current_domain_session
# existing session
(User.active.find(session[:user_id]) rescue nil)
(User.active.find(current_domain_session) rescue nil)
elsif autologin_user = try_to_autologin
autologin_user
elsif params[:format] == 'atom' && params[:key] && request.get? && accept_rss_auth?
@ -313,10 +315,10 @@ class ApplicationController < ActionController::Base
def try_to_autologin
if cookies[autologin_cookie_name]
# auto-login feature starts a new session
user = User.try_to_autologin(cookies[autologin_cookie_name])
if user
start_user_session(user)
end
user = nil
Rails.logger.info("111111111111111111#{default_yun_session}, session is #{session[:"#{default_yun_session}"]} ")
user = User.try_to_autologin(cookies[autologin_cookie_name]) if session[:"#{default_yun_session}"]
start_user_session(user) if user
user
end
end

@ -27,5 +27,6 @@ module LaboratoryHelper
def default_yun_session
@_default_yun_session = "#{request.subdomain.split('.').first}_user_id"
# @_default_yun_session = "#{current_laboratory.try(:identifier).split('.').first}_user_id"
end
end

@ -47,7 +47,7 @@ module LoginHelper
User.current.delete_session_token(session[:tk])
self.logged_user = nil
end
session[:user_id] = nil
session[:"#{default_yun_session}"] = nil
end
# Sets the logged in user
@ -73,8 +73,8 @@ module LoginHelper
# # session[:"#{request.subdomain}_user_id"] = user.id
# # end
session[:user_id] = user.id
# session[:"#{default_yun_session}"] = user.id
# session[:user_id] = user.id
session[:"#{default_yun_session}"] = user.id
session[:ctime] = Time.now.utc.to_i
session[:atime] = Time.now.utc.to_i
end

@ -35,7 +35,7 @@ class HackUserLastestCodesController < ApplicationController
# 提交结果显示
def result
if @my_hack.submit_status == 1
render json: {status:0, message: "正在评测中"}
render json: {status: 1, message: "正在评测中"}
else
@mode = params[:mode]
@result =

@ -12,7 +12,8 @@ class Oauth::BaseController < ActionController::Base
private
def session_user_id
session[:user_id]
# session[:user_id]
session[:"#{default_yun_session}"]
end
def current_user

@ -48,7 +48,8 @@ class Weapps::RegistersController < Weapps::BaseController
)
end
successful_authentication(@user)
session[:user_id] = @user.id
# session[:user_id] = @user.id
session[:"#{default_yun_session}"] = @user.id
# render_ok(user_id: @user.id)
end

@ -65,6 +65,12 @@
<% end %>
</li>
<li>
<%= sidebar_item_group('#comments-submenu', '消息', icon: 'comments') do %>
<li><%= sidebar_item(admins_shixun_feedback_messages_path, '实训反馈', icon: 'comment', controller: 'admins-shixun_feedback_messages') %></li>
<% end %>
</li>
<li>
<%= sidebar_item_group('#major-identification-submenu', '工程认证', icon: 'anchor') do %>
<li><%= sidebar_item(admins_major_informations_path, '本科专业目录', icon: 'outdent', controller: 'admins-major_informations') %></li>

@ -0,0 +1,14 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('实训反馈', admins_shixun_feedback_messages_path) %>
<% end %>
<div class="box search-form-container">
<%= form_tag(admins_shixun_feedback_messages_path, method: :get, class: 'form-inline search-form', remote: true) do %>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-md-4 ml-3', placeholder: '输入实训名称关键字进行搜索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<% end %>
</div>
<div class="box admin-list-container shixun_feedback_messages-list-container">
<%= render(partial: 'admins/shixun_feedback_messages/shared/list', locals: {discusses: @discusses}) %>
</div>

@ -0,0 +1,2 @@
$(".shixun_feedback_messages-list-container")
.html("<%= j render partial: "admins/shixun_feedback_messages/shared/list", locals: {discusses: @discusses} %>")

@ -0,0 +1,29 @@
<table class="table table-hover text-center">
<thead class="thead-light">
<tr>
<th width="5%">序号</th>
<th width="25%" class="text-left">实训名称</th>
<th width="50%" class="text-left">评论内容</th>
<th width="10%">评论者</th>
<th width="10%">评论时间</th>
</tr>
</thead>
<tbody>
<% if discusses.present? %>
<% discusses.each_with_index do |discuss, index| %>
<tr>
<td><%= (@params_page.to_i - 1) * 20 + index + 1 %></td>
<% identifier = Game.find_by(challenge_id: discuss.challenge_id, user_id: discuss.user_id)&.identifier %>
<td class="text-left"><%= link_to discuss.dis.name, "/tasks/#{identifier}", target: '_blank'%></td>
<td class="text-left"><%= content_safe discuss.content %></td>
<td><%= discuss.user.show_real_name %></td>
<td><%= format_time discuss.created_at %></td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: discusses } %>

@ -1,7 +1,12 @@
json.(@result, :id, :status, :error_line, :error_msg,
:input, :output, :execute_time, :execute_memory)
json.status 0
json.message "评测成功"
json.data do
json.(@result, :id, :status, :error_line, :error_msg,
:input, :output, :execute_time, :execute_memory)
# 提交模式多了一个预计输出
if @mode == "submit"
json.expected_output @result.expected_output
if @mode == "submit"
json.expected_output @result.expected_output
end
end

@ -1,5 +1,5 @@
# 编程内容
json.(@hack, :name, :description, :language, :code)
json.(@hack, :name, :description, :language, :difficult, :category, :time_limit, :open_or_not)
# 代码
json.language @hack.language

@ -1039,6 +1039,7 @@ Rails.application.routes.draw do
end
resources :shixuns, only: [:index,:destroy]
resources :shixun_settings, only: [:index,:update]
resources :shixun_feedback_messages, only: [:index]
resources :department_applies,only: [:index,:destroy] do
collection do
post :merge

@ -80,6 +80,27 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.inner-footernav li{float: left;height: 50px;width: 80px;text-align: center}
.inner-footernav li a{width: 100%;text-align: center;line-height: 50px;color: #888}
.inner-footer_con{ width: 1200px; margin: 0 auto;}
.inner-footernavysl{ display: flex;flex-direction:initial;}
.inner-footernavysl li a {
height: 40px;
line-height: 40px;
color:#878786;
font-size: 19px;
}
.inner-footernavysl li Link {
height: 40px;
line-height: 40px;
color:#878786;
}
.intermediatecenter{
width:100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.footer_con-p{ color: #888; margin-top:10px;}
/*banner图*/
.banner{width:100%;height:345px;position: relative;overflow: hidden;border-radius: 10px;}

@ -1,53 +1,127 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { Link } from 'react-router-dom';
import { getImageUrl, toPath } from 'educoder'
import React, {Component} from 'react';
import {Redirect} from 'react-router';
import {Link} from 'react-router-dom';
import {getImageUrl, toPath} from 'educoder'
import PropTypes from 'prop-types';
class NewFooter extends Component {
constructor(props) {
super(props)
constructor(props) {
super(props)
}
}
componentWillReceiveProps(newProps, newContext) {
componentWillReceiveProps(newProps, newContext) {
}
}
render() {
return (
<div className="newFooter edu-txt-center ">
render() {
return (
<div className="newFooter edu-txt-center ">
{/*newContainers*/}
<div className="inner-footer_con">
{this.props.user&&this.props.user.main_site===true?<div className="footercon">
{/* <div className="inline mt40 mb5">
<div className="inner-footer_con">
{this.props.user && this.props.user.main_site === true ? <div className="footercon">
{/* <div className="inline mt40 mb5">
<a href="/" className="fl" style={{height:'70px'}}>
<img alt="高校智能化教学与实训平台" src={getImageUrl(`images/educoder/headNavLogo.png?1526520218`)} width="70px">
</img>
</a>
<span className="fl color-grey-c cdefault font-28 ml22" style={{lineHeight:'74px'}}>EduCoder.net</span>
</div> */}
<ul className="clearfix inner-footernav">
<li><a href="/" className="fl" target="_blank">网站首页</a></li>
<li><Link to="/help/about_us" className="fl" target="_blank">关于我们</Link></li>
<li><Link to="/help/contact_us" className="fl" target="_blank">联系我们</Link></li>
<li><Link to="/help/cooperatives" className="fl" target="_blank">合作伙伴</Link></li>
<li><Link to="/help/agreement" className="fl" target="_blank">服务协议</Link></li>
<li><Link to="/help/help_center" className="fl" target="_blank">帮助中心</Link></li>
<li><Link to="/help/feedback" className="fl" target="_blank">意见反馈</Link></li>
</ul>
</div>:""}
<div>
{this.props.mygetHelmetapi === null ? "" :
this.props.mygetHelmetapi===undefined|| this.props.mygetHelmetapi.footer===null||this.props.mygetHelmetapi.footer===undefined?
<ul className="clearfix inner-footernav">
<li><a href="/" className="fl" target="_blank">网站首页</a></li>
<li><Link to="/help/about_us" className="fl" target="_blank">关于我们</Link></li>
<li><Link to="/help/contact_us" className="fl" target="_blank">联系我们</Link></li>
<li><Link to="/help/cooperatives" className="fl" target="_blank">合作伙伴</Link></li>
<li><Link to="/help/agreement" className="fl" target="_blank">服务协议</Link></li>
<li><Link to="/help/help_center" className="fl" target="_blank">帮助中心</Link></li>
<li><Link to="/help/feedback" className="fl" target="_blank">意见反馈</Link></li>
</ul>
</div> : ""}
<style>
{
`
.inner-footernavysl{ display: flex;
flex-direction:initial;}
.inner-footernavysl li a {
height: 40px;
line-height: 40px;
color:#878786;
font-size: 19px;
}
.inner-footernavysl li Link {
height: 40px;
line-height: 40px;
color:#878786;
}
.intermediatecenter{
width:100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
`
}
</style>
<div className="intermediatecenter"
>
<ul className="clearfix inner-footernavysl ">
<li><a href="/" className="fl" target="_blank" style={{
fontSize: "20px",
color: "#878786",
}}>官方合作</a></li>
<li className="ml3"><a href="http://www.cmooc.cn/" className="fl" target="_blank">中国高校计算机教育MOOC联盟</a></li>
<div className="ml15" style={{
"width": "2px",
"height": "20px",
"background": "rgb(151, 151, 151)",
"line-height": "40px",
"margin-top": "10px",
}}></div>
<li className="ml15"><a href="http://xgk.csia.org.cn/" className="fl" target="_blank">信息技术新工科产学研联盟</a></li>
<div className="ml15" style={{
"width": "2px",
"height": "20px",
"background": "rgb(151, 151, 151)",
"line-height": "40px",
"margin-top": "10px",
}}></div>
<li className="ml15"><a href="https://www.ccf.org.cn/" className="fl" target="_blank">中国计算机学会</a></li>
<div className="ml15" style={{
"width": "2px",
"height": "20px",
"background": "rgb(151, 151, 151)",
"line-height": "40px",
"margin-top": "10px",
}}></div>
<li className="ml15"><a href="http://www.copu.org.cn/" className="fl" target="_blank">中国开源软件推进联盟</a></li>
<div className="ml15" style={{
"width": "2px",
"height": "20px",
"background": "rgb(151, 151, 151)",
"line-height": "40px",
"margin-top": "10px",
}}></div>
<li className="ml15"><a href="http://opengcc.org/" className="fl" target="_blank">绿色计算产业联盟</a></li>
</ul>
</div>
<div>
{this.props.mygetHelmetapi === null ? "" :
this.props.mygetHelmetapi === undefined || this.props.mygetHelmetapi.footer === null || this.props.mygetHelmetapi.footer === undefined ?
<p className="footer_con-p inline lineh-30 font-14">
<span className="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder
<a style={{"color":"#888"}} target="_blank" href="http://beian.miit.gov.cn/" className="ml15 mr15">湘ICP备17009477号</a>
<a style={{"color":"#888"}} target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43019002000962" className="mr15">
<a style={{"color": "#888"}} target="_blank" href="http://beian.miit.gov.cn/"
className="ml15 mr15">湘ICP备17009477号</a>
<a style={{"color": "#888"}} target="_blank"
href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43019002000962"
className="mr15">
<img className="vertical4" src={require('./beian.png')}/>湘公网安备43019002000962号
</a>
<a href="https://team.trustie.net" style={{"color":"#888"}}
<a href="https://team.trustie.net" style={{"color": "#888"}}
target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&amp;&nbsp;&nbsp;&nbsp;IntelliDE inside. <span
className="mr15">版权所有 湖南智擎科技有限公司</span>
</p>
@ -56,12 +130,12 @@ class NewFooter extends Component {
}
</div>
<div className="cl"></div>
</div>
</div>
);
}
</div>
<div className="cl"></div>
</div>
</div>
);
}
}
export default NewFooter;

@ -84,6 +84,27 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.inner-footernav li{float: left;height: 50px;width: 80px;text-align: center}
.inner-footernav li a{width: 100%;text-align: center;line-height: 50px;color: #888}
.inner-footer_con{ width: 1200px; margin: 0 auto;}
.inner-footernavysl{ display: flex;flex-direction:initial;}
.inner-footernavysl li a {
height: 40px;
line-height: 40px;
color:#878786;
font-size: 19px;
}
.inner-footernavysl li Link {
height: 40px;
line-height: 40px;
color:#878786;
}
.intermediatecenter{
width:100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.footer_con-p{ color: #888; margin-top:10px;}
/*banner图*/
.banner{width:100%;height:345px;position: relative;overflow: hidden;border-radius: 10px;}
@ -3773,4 +3794,4 @@ a.singlepublishtwo{
.fontweightbold{
font-weight: bold !important;
}
}

Loading…
Cancel
Save