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

dev_forum
daiao 6 years ago
commit 3135e7a4d6

@ -528,6 +528,14 @@ class ShixunsController < ApplicationController
tip_show_exception("/myshixuns/#{current_myshixun.try(:identifier)}/reset_my_game")
end
if current_myshixun.repo_name.nil?
g = Gitlab.client
repo_name = g.project(current_myshixun.gpid).try(:path_with_namespace)
current_myshixun.update_column(:repo_name, repo_name)
end
# 如果存在实训,则直接进入实训
# 如果实训允许跳关传参params[:challenge_id]跳入具体的关卡
@current_task =

@ -2,7 +2,7 @@ module Searchable::Shixun
extend ActiveSupport::Concern
included do
searchkick language: 'chinese'#, callbacks: :async
searchkick language: 'chinese', callbacks: :async
scope :search_import, -> { includes(:shixun_info, :challenges, :challenge_tags, :users, user: { user_extension: :school }) }
end

@ -20,7 +20,17 @@ module ElasticsearchAble
def highlight_options
{
fragment_size: EduSetting.get('es_highlight_fragment_size') || 30,
tag: '<span class="highlight">'
tag: '<span class="highlight">',
fields: {
name: { type: 'plain' },
subject: { type: 'plain' },
challenge_names: { type: 'plain' },
challenge_tag_names: { type: 'plain' },
description: { type: 'plain' },
subject_stages: { type: 'plain' },
content: { type: 'plain' },
descendants_contents: { type: 'plain' },
}
}
end

@ -13,7 +13,7 @@ class Users::BindEmailService < ApplicationService
raise Error, '该邮箱已被绑定' if User.where.not(id: user.id).exists?(mail: params[:email])
code = VerificationCode.where(mail: params[:email], code: params[:code], code_type: 4).last
code = VerificationCode.where(email: params[:email], code: params[:code], code_type: 4).last
raise Error, '验证码无效' unless code&.effective?
ActiveRecord::Base.transaction do

Loading…
Cancel
Save