diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1edd3bcf5..411481f0e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -23,23 +23,23 @@ class ApplicationController < ActionController::Base # 所有请求必须合法签名 def check_sign - # if !Rails.env.development? - # Rails.logger.info("66666 #{params}") - # # suffix = request.url.split(".").last.split("?").first - # # suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释 - # # unless suffix_arr.include?(suffix) - # if params[:client_key].present? - # randomcode = params[:randomcode] - # # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5) - # - # sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}") - # Rails.logger.info("2222 #{sign}") - # tip_exception(501, "请求不合理") if sign != params[:client_key] - # else - # tip_exception(501, "请求不合理") - # end - # # end - # end + if !Rails.env.development? + Rails.logger.info("66666 #{params}") + # suffix = request.url.split(".").last.split("?").first + # suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释 + # unless suffix_arr.include?(suffix) + if params[:client_key].present? + randomcode = params[:randomcode] + # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5) + + sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}") + Rails.logger.info("2222 #{sign}") + tip_exception(501, "请求不合理") if sign != params[:client_key] + else + tip_exception(501, "请求不合理") + end + # end + end end # 全局配置参数 diff --git a/lib/tasks/statistic_subject_info.rake b/lib/tasks/statistic_subject_info.rake index c510c60fb..c17823a33 100644 --- a/lib/tasks/statistic_subject_info.rake +++ b/lib/tasks/statistic_subject_info.rake @@ -9,8 +9,8 @@ namespace :subjects do buffer_size = 0 column_value = "subject_id, study_count, course_study_count, initiative_study, passed_count, course_used_count, " + "school_used_count, created_at, updated_at" - subjects.find_in_batches(batch_size: 50) do |s, index| - Parallel.each_with_index(s, in_processes: 4) do |subject| + subjects.find_in_batches(batch_size: 50) do |s| + Parallel.each(s, in_processes: 4) do |subject| puts("---------------------data_statistic: #{subject.id}") Rails.logger.info("---------------------data_statistic: #{subject.id}") data = Subjects::DataStatisticService.new(subject) @@ -23,7 +23,8 @@ namespace :subjects do "#{data.passed_count}, #{data.course_used_count}, #{data.school_used_count}, " + "'#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')") buffer_size += 1 - if buffer_size == 1000 || subjects.count == (index+1) + puts "buffer_size: #{buffer_size}; subject: #{subject == s.last}; index:#{index+1}" + if buffer_size == 1000 || subject == s.last sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str}" puts sql ActiveRecord::Base.connection.execute sql diff --git a/public/favicon.ico b/public/favicon.ico index 05b9d163e..9c65fe8c7 100755 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/react/src/common/components/form/City.js b/public/react/src/common/components/form/City.js index b397c8b59..520a2ebbf 100644 --- a/public/react/src/common/components/form/City.js +++ b/public/react/src/common/components/form/City.js @@ -120,7 +120,7 @@ const options = [{ value: '广东', label: '广东', children: [{ - value: "广州", + value: "广州", label: '广州' },{ value: '深圳', @@ -493,6 +493,9 @@ const options = [{ children: [{ value: "兰州", label: '兰州' + },{ + value: "嘉峪关", + label: '嘉峪关' },{ value: '白银', label: '白银' @@ -537,7 +540,7 @@ const options = [{ value: '广西', label: '广西', children: [{ - value: "南宁", + value: "南宁", label: '南宁' },{ value: '百色', diff --git a/public/react/src/modules/paths/statics/index.js b/public/react/src/modules/paths/statics/index.js index 46689311d..b10809f99 100644 --- a/public/react/src/modules/paths/statics/index.js +++ b/public/react/src/modules/paths/statics/index.js @@ -247,7 +247,7 @@ const App = (props) => {
学习统计 - Android综合实训之物联网移动应用 +