Merge branch 'dev_aliyun' into develop

dev_tj
daiao 5 years ago
commit 03cd87e467

@ -23,7 +23,7 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名
def check_sign
if !Rails.env.development?
if !Rails.env.development? && EduSetting.get("host_name") != "https://test-newweb.educoder.net"
Rails.logger.info("66666 #{params}")
# suffix = request.url.split(".").last.split("?").first
# suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释

@ -26,14 +26,14 @@ class HelpsController < ApplicationController
def feedback
if params[:url].blank?
content = "<p>[#{params[:question_kind]}]</p></p>#{params[:description]}"
content = "[#{params[:question_kind]}]<br>#{params[:description]}<br>"
if params[:attachment_ids]
params[:attachment_ids].each do |attachment_id|
content += "![](/api/attachments/#{attachment_id})"
content += "![](/api/attachments/#{attachment_id})<br>"
end
end
else
content = "<p>[#{params[:question_kind]}]</p><p>问题页面网址:#{params[:url]}</p>#{params[:description]}"
content = "[#{params[:question_kind]}]<br>问题页面网址:#{params[:url]}<br>#{params[:description]}"
end
ActiveRecord::Base.transaction do

@ -1,6 +1,6 @@
class MemosController < ApplicationController
before_action :require_login, except: [:show, :index]
before_action :check_account, only: [:new, :create]
before_action :check_account, only: [:new, :create, :reply]
before_action :set_memo, only: [:show, :edit, :update, :destroy, :sticky_or_cancel, :hidden, :more_reply]
before_action :validate_memo_params, only: [:create, :update]
before_action :owner_or_admin, only: [:edit, :update, :destroy]

@ -13,6 +13,7 @@ class SubjectsController < ApplicationController
include ApplicationHelper
include SubjectsHelper
include GitCommon
include CustomSortable
def index
@tech_system = current_laboratory.subject_repertoires

@ -9,18 +9,18 @@ class Users::InterestsController < Users::BaseController
extension = current_user.user_extension || current_user.build_user_extension
return render_error('请选择职业') unless %w(teacher student professional).include?(identity)
interest_ids = Array.wrap(params[:interest_ids]).map(&:to_i)
return render_error('请选择兴趣') if interest_ids.blank?
# interest_ids = Array.wrap(params[:interest_ids]).map(&:to_i)
# return render_error('请选择兴趣') if interest_ids.blank?
ActiveRecord::Base.transaction do
extension.update_column(:identity, identity)
# 兴趣
UserInterest.bulk_insert(:user_id, :repertoire_id) do |worker|
(Repertoire.pluck(:id) & interest_ids).each do |repertoire_id|
worker.add(user_id: current_user.id, repertoire_id: repertoire_id)
end
end
# UserInterest.bulk_insert(:user_id, :repertoire_id) do |worker|
# (Repertoire.pluck(:id) & interest_ids).each do |repertoire_id|
# worker.add(user_id: current_user.id, repertoire_id: repertoire_id)
# end
# end
end
render_ok

@ -19,11 +19,10 @@ class Weapps::VerificationCodesController < Weapps::BaseController
return render_error('请输入正确的邮箱或手机号')
end
code = %W(0 1 2 3 4 5 6 7 8 9)
verification_code = code.sample(6).join
send_type = login =~ /^1\d{10}$/ ? 1 : 8
# 记录验证码
check_verification_code(verification_code, send_type, login)
# 发送验证码
send_code(send_type, login)
render_ok
end
@ -40,12 +39,21 @@ class Weapps::VerificationCodesController < Weapps::BaseController
return render_error('请输入正确的邮箱或手机号')
end
send_type = login =~ /^1\d{10}$/ ? 2 : 3
# 发送验证码
send_code(send_type, login)
render_ok
end
def send_code send_type, login
code = %W(0 1 2 3 4 5 6 7 8 9)
verification_code = code.sample(6).join
send_type = login =~ /^1\d{10}$/ ? 2 : 3
# 记录验证码
check_verification_code(verification_code, send_type, login)
sign = Digest::MD5.hexdigest("#{OPENKEY}#{login}")
tip_exception(501, "请求不合理") if sign != params[:smscode]
render_ok
check_verification_code(verification_code, send_type, login)
end
end

@ -64,7 +64,7 @@ class GitService
end
def parse_return(body)
logger.info("--uri_exec: .....res is #{body}")
#logger.info("--uri_exec: .....res is #{body}")
content = JSON.parse(body)
if content["code"] != 0

@ -0,0 +1,6 @@
json.status 0
json.message "success"
json.data do
json.subject_info @subject.subject_record
json.other_info @data
end

@ -7,6 +7,7 @@ json.admin user.admin?
json.business user.business?
json.is_teacher user.user_extension&.teacher?
json.user_identity user.identity
json.identity user.user_extension&.identity
json.tidding_count 0
json.user_phone_binded user.phone.present?
json.phone user.phone

@ -613,7 +613,6 @@ a级情片
大史纪
戴相龙
弹劾
登辉
邓笑贫
迪里夏提
地下教会

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Loading…
Cancel
Save