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

dev_forum
daiao 5 years ago
commit e81509e396

@ -32,11 +32,8 @@ class AccountsController < ApplicationController
end
uid_logger("start register: verifi_code is #{verifi_code}, code is #{code}, time is #{Time.now.to_i - verifi_code.try(:created_at).to_i}")
# check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60)
# todo 上线前请删除万能验证码"513231"
if code != "513231"
return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
return normal_status(-2, "验证码已失效") if !verifi_code&.effective?
end
code = generate_identifier User, 8
login = pre + code

@ -14,7 +14,7 @@ class AttachmentsController < ApplicationController
update_downloads(@file)
redirect_to @file.cloud_url and return
end
send_file absolute_path(local_path(@file)), type: @file.content_type
send_file absolute_path(local_path(@file)), type: @file.content_type.presence || 'application/octet-stream'
update_downloads(@file)
end

@ -949,7 +949,7 @@ class HomeworkCommonsController < ApplicationController
# 最热排序
if reorder == "myshixun_count"
if select
if select && select != "all"
@subjects = Subject.find_by_sql("SELECT subjects.id, subjects.user_id, subjects.name, subjects.stages_count, subjects.repertoire_id, subjects.status,
subjects.shixuns_count, sum(shixuns.myshixuns_count) AS myshixun_member_count FROM subjects join stage_shixuns
on stage_shixuns.subject_id = subjects.id join shixuns on shixuns.id = stage_shixuns.shixun_id where
@ -973,7 +973,7 @@ class HomeworkCommonsController < ApplicationController
end
# 类型
if select
if select && select != "all"
@subjects = @subjects.where(repertoire_id: select)
end

Loading…
Cancel
Save