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

dev_forum
daiao 6 years ago
commit 542d5cc65b

@ -35,7 +35,7 @@ class AccountsController < ApplicationController
# todo 上线前请删除万能验证码"513231" # todo 上线前请删除万能验证码"513231"
if code != "513231" if code != "513231"
tip_exception(-2, "验证码不正确") if verifi_code.try(:code) != code.strip tip_exception(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
tip_exception(-2, "验证码已失效") if (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60 tip_exception(-2, "验证码已失效") if (Time.now.to_i - verifi_code.created_at.to_i) > 10*60
end end
code = generate_identifier User, 8 code = generate_identifier User, 8
@ -95,7 +95,7 @@ class AccountsController < ApplicationController
user = User.find_by_mail(email) #这里有问题应该是为email,而不是mail 6.13-hs user = User.find_by_mail(email) #这里有问题应该是为email,而不是mail 6.13-hs
end end
tip_exception(-2, "验证码不正确") if verifi_code.try(:code) != code.strip tip_exception(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
tip_exception(-2, "验证码已失效") if (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60 tip_exception(-2, "验证码已失效") if (Time.now.to_i - verifi_code.created_at.to_i) > 10*60
user.password, user.password_confirmation = params[:new_password], params[:new_password_confirmation] user.password, user.password_confirmation = params[:new_password], params[:new_password_confirmation]
if user.save! if user.save!

@ -4,7 +4,7 @@ class AddSchoolApplyForm
attr_accessor :name, :province, :city, :address, :remarks attr_accessor :name, :province, :city, :address, :remarks
validates :name, presence: true validates :name, presence: true
validates :province, presence: true # validates :province, presence: true
validates :city, presence: true # validates :city, presence: true
validates :address, presence: true # validates :address, presence: true
end end

@ -43,6 +43,7 @@ module Searchable::Shixun
def to_searchable_json def to_searchable_json
{ {
id: id, id: id,
identifier: identifier,
author_name: user.real_name, author_name: user.real_name,
author_school_name: user.school_name, author_school_name: user.school_name,
visits_count: visits, visits_count: visits,
@ -55,4 +56,4 @@ module Searchable::Shixun
{ user: { user_extension: :school } } { user: { user_extension: :school } }
end end
end end
end end

@ -20,7 +20,7 @@ module ElasticsearchAble
def highlight_options def highlight_options
{ {
fragment_size: EduSetting.get('es_highlight_fragment_size') || 30, fragment_size: EduSetting.get('es_highlight_fragment_size') || 30,
tag: '<span>' tag: '<span class="highlight">'
} }
end end

@ -8,7 +8,7 @@ json.test_sets @qurey_test_sets do |test_set|
end end
json.compile_success test_set.try(:compile_success) json.compile_success test_set.try(:compile_success)
json.ts_time test_set.try(:ts_time) json.ts_time test_set.try(:ts_time)
json.ts_time test_set.try(:ts_mem) json.ts_mem test_set.try(:ts_mem)
end end
json.allowed_unlock @shixun.test_set_permission json.allowed_unlock @shixun.test_set_permission

@ -1,4 +1,4 @@
json.(@base_date, :grade, :gold, :experience, :status, :had_done, :position, :port, :record_consume_time, :mirror_name, json.(@base_date, :grade, :gold, :experience, :status, :had_done, :position, :port, :record_consume_time, :mirror_name,
:picture, :web_route, :star, :next_game, :prev_game, :max_mem) :picture, :web_route, :star, :next_game, :prev_game)
# # 测试集相关 # # 测试集相关
json.partial! 'games/testset_list' json.partial! 'games/testset_list'

@ -1,5 +1,5 @@
class AddTsMemToOutputs < ActiveRecord::Migration[5.2] class AddTsMemToOutputs < ActiveRecord::Migration[5.2]
def change def change
# add_column :outputs, :ts_mem, :float add_column :outputs, :ts_mem, :float
end end
end end

Loading…
Cancel
Save