mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
FIX api bug
This commit is contained in:
@@ -5,7 +5,7 @@ class ApplicationController < ActionController::Base
|
||||
include RenderExpand
|
||||
include RenderHelper
|
||||
include ControllerRescueHandler
|
||||
# include LaboratoryHelper
|
||||
include LaboratoryHelper
|
||||
include GitHelper
|
||||
include LoggerHelper
|
||||
include LoginHelper
|
||||
|
||||
@@ -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
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
# 用户回复功能
|
||||
|
||||
Reference in New Issue
Block a user