From dbfef204343685e9312542f6803f6438efbc8dda Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Thu, 9 Jul 2020 19:43:17 +0800 Subject: [PATCH] change bugs --- app/controllers/sync_forge_controller.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/controllers/sync_forge_controller.rb b/app/controllers/sync_forge_controller.rb index 2e1e2995..e9b3f62e 100644 --- a/app/controllers/sync_forge_controller.rb +++ b/app/controllers/sync_forge_controller.rb @@ -2,11 +2,10 @@ class SyncForgeController < ApplicationController before_action :check_token def create - sync_params = params["sync_params"] - Rails.logger.info("========sync_params=1==#{params["sync_params"]}====") + sync_params = params[:sync_params] Rails.logger.info("========sync_params=2==#{params[:sync_params]}====") - sync_params = eval(sync_params) + # sync_params = eval(sync_params) #以前已同步的项目,那么肯定存在仓库 if Project.exists?(id: sync_params[:id], identifier: sync_params[:identifier]) @@ -188,7 +187,7 @@ class SyncForgeController < ApplicationController end def check_token - sync_params = params[:sync_params][0] + sync_params = params[:sync_params] unless sync_params[:token] && sync_params[:token] == get_token render json: {message: "token_errors"} end