Merge branch 'standalone_develop' into pre_trustie_server
This commit is contained in:
commit
b4c5991bc8
|
@ -702,6 +702,15 @@ class UsersController < ApplicationController
|
||||||
@user = User.find_by(mail: params[:email])
|
@user = User.find_by(mail: params[:email])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#根据login获取用户信息
|
||||||
|
def get_user_info_by_login
|
||||||
|
private_token = "hriEn3UwXfJs3PmyXnSH"
|
||||||
|
sign = Digest::MD5.hexdigest("#{private_token}:#{params[:login]}")
|
||||||
|
tip_exception(401, '401 Unauthorized') unless params[:sign].to_s == sign
|
||||||
|
user = User.find_by_login params[:login]
|
||||||
|
render_ok(data: {username: user.real_name, school: user.custom_department, login: user.login, phone: user.phone, mail: user.mail})
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def load_user
|
def load_user
|
||||||
@user = User.find_by_login(params[:id]) || User.find_by(id: params[:id])
|
@user = User.find_by_login(params[:id]) || User.find_by(id: params[:id])
|
||||||
|
@ -731,7 +740,7 @@ class UsersController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def sso_login
|
def sso_login
|
||||||
if params[:login].present? && !current_user.logged? && params[:websiteName].present?
|
if params[:login].present? && !current_user.logged? && params[:websiteName].present? && request.referer.to_s.include?("gitlink.org.cn")
|
||||||
user = User.where("login = ?", "#{params[:login].presence}").first
|
user = User.where("login = ?", "#{params[:login].presence}").first
|
||||||
# 已同步注册,直接登录
|
# 已同步注册,直接登录
|
||||||
if user.present?
|
if user.present?
|
||||||
|
|
|
@ -3,7 +3,7 @@ class VersionReleasesController < ApplicationController
|
||||||
before_action :load_repository
|
before_action :load_repository
|
||||||
before_action :set_user
|
before_action :set_user
|
||||||
before_action :require_login, except: [:index, :show]
|
before_action :require_login, except: [:index, :show]
|
||||||
before_action :check_release_authorize, except: [:index, :show]
|
before_action :check_release_authorize, except: [:index, :show, :download]
|
||||||
before_action :find_version , only: [:show, :edit, :update, :destroy]
|
before_action :find_version , only: [:show, :edit, :update, :destroy]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
|
|
@ -13,10 +13,7 @@ class Admins::GlccExamineMaterial < ApplicationQuery
|
||||||
materials = GlccMediumTermExamineMaterial.all
|
materials = GlccMediumTermExamineMaterial.all
|
||||||
|
|
||||||
# term
|
# term
|
||||||
term = params[:term] || [1,2]
|
materials = materials.where(term: params[:term]) if params[:term].present?
|
||||||
if term.present?
|
|
||||||
materials = materials.where(term: term)
|
|
||||||
end
|
|
||||||
#year
|
#year
|
||||||
year = if params[:date]
|
year = if params[:date]
|
||||||
params[:date][:year]
|
params[:date][:year]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<%= form_tag(admins_glcc_pr_check_index_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
|
<%= form_tag(admins_glcc_pr_check_index_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
|
||||||
<div class="form-group mr-2">
|
<div class="form-group mr-2">
|
||||||
<label for="status">考核选项:</label>
|
<label for="status">考核选项:</label>
|
||||||
<% status_options = [['中期考核',1], ['结项考核', 2]] %>
|
<% status_options = [['全部',''],['中期考核',1], ['结项考核', 2]] %>
|
||||||
<%= select_tag(:term, options_for_select(status_options), class: 'form-control') %>
|
<%= select_tag(:term, options_for_select(status_options), class: 'form-control') %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
<%= form_tag(send_mail_admins_glcc_pr_check_index_path, method: :post, class: 'form-inline search-form flex-1', remote: true) do %>
|
<%= form_tag(send_mail_admins_glcc_pr_check_index_path, method: :post, class: 'form-inline search-form flex-1', remote: true) do %>
|
||||||
<div class="form-group mr-2">
|
<div class="form-group mr-2">
|
||||||
<label for="status"> 请选择考核选项:</label>
|
<label for="status"> 请选择考核选项:</label>
|
||||||
<% status_options = [['中期考核',1], ['结项考核', 2]] %>
|
<% status_options = [['全部',''],['中期考核',1], ['结项考核', 2]] %>
|
||||||
<%= select_tag(:term, options_for_select(status_options), class: 'form-control') %>
|
<%= select_tag(:term, options_for_select(status_options), class: 'form-control') %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ json.setting do
|
||||||
json.name default_setting.name
|
json.name default_setting.name
|
||||||
json.nav_logo_url default_setting.nav_logo_url&.[](1..-1)
|
json.nav_logo_url default_setting.nav_logo_url&.[](1..-1)
|
||||||
json.login_logo_url default_setting.login_logo_url&.[](1..-1)
|
json.login_logo_url default_setting.login_logo_url&.[](1..-1)
|
||||||
json.tab_logo_url default_setting.tab_logo_url&.[](1..-1)
|
json.tab_logo_url default_setting.tab_logo_url.present? ? default_setting.tab_logo_url&.[](1..-1) : "favicon.ico"
|
||||||
json.site_page_deploy_domain @deploy_domain
|
json.site_page_deploy_domain @deploy_domain
|
||||||
|
|
||||||
json.subject_banner_url default_setting.subject_banner_url&.[](1..-1)
|
json.subject_banner_url default_setting.subject_banner_url&.[](1..-1)
|
||||||
|
|
|
@ -288,6 +288,7 @@ Rails.application.routes.draw do
|
||||||
post :following
|
post :following
|
||||||
post :unfollow
|
post :unfollow
|
||||||
get :get_user_info
|
get :get_user_info
|
||||||
|
get :get_user_info_by_login
|
||||||
get :attachment_show
|
get :attachment_show
|
||||||
get :html_show
|
get :html_show
|
||||||
get :get_navigation_info
|
get :get_navigation_info
|
||||||
|
|
Loading…
Reference in New Issue