From d75882030eab932b72d4502f58ca1c3cff604ecd Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Sat, 14 Mar 2020 00:17:18 +0800 Subject: [PATCH 1/6] FIX api bug --- app/controllers/application_controller.rb | 2 +- app/controllers/concerns/laboratory_helper.rb | 2 +- app/controllers/users_controller.rb | 35 +++++-------------- app/views/users/get_user_info.json.jbuilder | 17 --------- 4 files changed, 10 insertions(+), 46 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4462eac..d689742 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base include RenderExpand include RenderHelper include ControllerRescueHandler - # include LaboratoryHelper + include LaboratoryHelper include GitHelper include LoggerHelper include LoginHelper diff --git a/app/controllers/concerns/laboratory_helper.rb b/app/controllers/concerns/laboratory_helper.rb index e03273d..fea1565 100644 --- a/app/controllers/concerns/laboratory_helper.rb +++ b/app/controllers/concerns/laboratory_helper.rb @@ -29,4 +29,4 @@ module LaboratoryHelper laboratory ||= (Laboratory.find_by_subdomain(request.subdomain) || Laboratory.find(1)) @_default_yun_session = "#{laboratory.try(:identifier).split('.').first}_user_id" end -end \ No newline at end of file +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 544a49c..a2fb9e8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -29,25 +29,6 @@ class UsersController < ApplicationController @user = current_user # TODO 等消息上线再打开注释 #@tidding_count = unviewed_tiddings(current_user) if current_user.present? - @course = - if params[:course_id] - Course.find params[:course_id] - elsif params[:board_id] - Board.find(params[:board_id]).course - elsif params[:graduation_topic_id] - GraduationTopic.find(params[:graduation_topic_id]).course - elsif params[:graduation_group_id] - GraduationGroup.find(params[:graduation_group_id]).course - elsif params[:graduation_work_id] - GraduationWork.find(params[:graduation_work_id]).course - elsif params[:graduation_task_id] - GraduationTask.find(params[:graduation_task_id]).course - elsif params[:poll_id] - Poll.find(params[:poll_id]).course - elsif params[:attachment_id] - Attachment.find(params[:attachment_id]).course - end - @course_identity = current_user.course_identity(@course) if @course rescue Exception => e uid_logger_error(e.message) missing_template @@ -72,14 +53,14 @@ class UsersController < ApplicationController # Redo: 消息总数缓存 def get_navigation_info - @old_domain = edu_setting('old_edu_host') - @user = current_user - # 新消息数 - @new_message = @user.tidings.where("created_at > '#{@user.click_time}'").count > 0 || @user.private_messages.where("created_at > '#{@user.click_time}'").count > 0 - - @user_url = "/users/#{@user.login}" - @career = Career.where(status: true).order("created_at asc").pluck(:id, :name) - @auth = User.current.ec_school.present? ? "#{@old_domain}/ecs/department?school_id=#{User.current.ec_school}" : nil + # @old_domain = edu_setting('old_edu_host') + # @user = current_user + # # 新消息数 + # @new_message = @user.tidings.where("created_at > '#{@user.click_time}'").count > 0 || @user.private_messages.where("created_at > '#{@user.click_time}'").count > 0 + # + # @user_url = "/users/#{@user.login}" + # @career = Career.where(status: true).order("created_at asc").pluck(:id, :name) + # @auth = User.current.ec_school.present? ? "#{@old_domain}/ecs/department?school_id=#{User.current.ec_school}" : nil end # 用户回复功能 diff --git a/app/views/users/get_user_info.json.jbuilder b/app/views/users/get_user_info.json.jbuilder index eeb66f6..a270297 100644 --- a/app/views/users/get_user_info.json.jbuilder +++ b/app/views/users/get_user_info.json.jbuilder @@ -13,20 +13,3 @@ json.phone @user.phone json.email @user.mail json.profile_completed @user.profile_completed? json.professional_certification @user.professional_certification -json.main_site current_laboratory.main_site? -json.is_shixun_marker current_user.is_shixun_marker? || current_user.admin_or_business? -if @course - json.course_identity @course_identity - json.course_name @course.name - json.course_public @course.is_public - json.course_excellent @course.excellent - if params[:group_info] - json.group_info @course.teacher_group(@user.id) if @course_identity < Course::STUDENT - end - json.first_category_url module_url(@course.none_hidden_course_modules.first, @course) - json.course_is_end @course.is_end -end - -if params[:school] - json.user_school @user.school_name -end From 879b5eb5fec29e98372348e105c9f0864e2bbefe Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Sat, 14 Mar 2020 16:25:11 +0800 Subject: [PATCH 2/6] =?UTF-8?q?FIX=20=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=8B=E6=8B=89=E6=97=A0=E6=95=88=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/forge/Main/Index.js | 2 +- public/react/src/modules/tpm/NewFooter.js | 71 +++++++---------------- 2 files changed, 22 insertions(+), 51 deletions(-) diff --git a/public/react/src/forge/Main/Index.js b/public/react/src/forge/Main/Index.js index 6f99707..fe5d065 100644 --- a/public/react/src/forge/Main/Index.js +++ b/public/react/src/forge/Main/Index.js @@ -201,7 +201,7 @@ class Index extends Component{ :"" ) return( -
- © {moment().year()} EduCoder - 湘ICP备17009477号 - - 湘公网安备43019002000962号 - - Trustie & IntelliDE inside. 版权所有 湖南智擎科技有限公司 -
- : - - - } - -+ © {moment().year()} EduCoder + 湘ICP备17009477号 + + 湘公网安备43019002000962号 + + Trustie & IntelliDE inside. 版权所有 湖南智擎科技有限公司 +
+