diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 65d671856..3a4592b2f 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -405,11 +405,7 @@ class ShixunsController < ApplicationController # 超级管理员和运营人员才能保存 中间层服务器pod信息的配置 if current_user.admin? || current_user.business? @shixun.shixun_service_configs.destroy_all - ActionController::Parameters.permit_all_parameters = true - logger.info("##--;;;;---#{params[:shixun_service_configs]}") - params[:shixun_service_configs].each do |config| - @shixun.shixun_service_configs.create!(config) - end + @shixun.shixun_service_configs.create!(service_config_params[:shixun_service_configs]) end rescue Exception => e uid_logger_error(e.message) @@ -745,6 +741,11 @@ private params.require(:shixun_info).permit(:description, :evaluate_script) end + + def service_config_params + params.permit(shixun_service_configs: [:cpu_limit, :lower_cpu_limit, :memory_limit, :request_limit, :mirror_repository_id]) + end + def find_shixun @shixun = Shixun.find_by_identifier(params[:identifier]) if @shixun.blank?