From ec87aef778584ca2768833d4ba38f13e8e5a686c Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Tue, 12 Mar 2019 21:09:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ecloud_controller.rb | 14 +++++--------- config/routes.rb | 4 ++-- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/controllers/ecloud_controller.rb b/app/controllers/ecloud_controller.rb index fe7ea1ab..077b463e 100644 --- a/app/controllers/ecloud_controller.rb +++ b/app/controllers/ecloud_controller.rb @@ -5,7 +5,7 @@ require 'digest' class EcloudController < ApplicationController skip_before_filter :verify_authenticity_token - before_filter :check_sign + # before_filter :check_sign before_filter :user_setup before_filter :require_login, only: [:authorize] @@ -20,10 +20,8 @@ class EcloudController < ApplicationController def trustie_login end - # CLIENT_ID = '1022' - CLIENT_ID = '124124' - CLIENT_SECRET = '72ff7f4e-9b2e-4b33-8232-07cb0d08bbf3' - # CLIENT_SECRET = '2112037a-6d7a-432b-9081-feb1153d8668' + CLIENT_ID = '1022' + CLIENT_SECRET = '2112037a-6d7a-432b-9081-feb1153d8668' ROOT_URl = 'http://localhost:3000' SERVER_URL = "https://221.176.54.92:9081/restful/services/" @@ -64,11 +62,11 @@ class EcloudController < ApplicationController ActiveRecord::Base.transaction do begin ecloud = Ecloud.where(custid: params['custid']).first - ecloud.update_attribute(applyno: params['applyno'], ecordercode: params['ecordercode'], opttype: params['opttype'], + ecloud.update_attributes!(applyno: params['applyno'], ecordercode: params['ecordercode'], opttype: params['opttype'], custid: params['custid'], custcode: params['custcode'], productcode: params['productcode'], operatime: params['operatime'], effecttime: params['effecttime']) services = params['ervices'].first - ecloud.ecloud_services.update_attributes(packagecode: services['packagecode'], bossorderid: services['bossorderid']) + ecloud.ecloud_services.update_attributes!(packagecode: services['packagecode'], bossorderid: services['bossorderid']) rescue Exception => e logger.error(e.message) @@ -189,8 +187,6 @@ class EcloudController < ApplicationController private def check_sign sign = sign(params['timestamp']) - logger.info("######@2222#{sign}") - logger.info("######@2222#{params['sign']}") if sign != params['sign'] render :json => {code: 501, msg: "sign的值错误"} return diff --git a/config/routes.rb b/config/routes.rb index f2594596..964a8732 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -35,9 +35,9 @@ RedmineApp::Application.routes.draw do ## oauth相关 get 'ecloud/ecloud_login', to: 'ecloud#ecloud_login_callback' post 'ecloud/bs_new', to: 'ecloud#bs_new' - post 'ecloud/bs_edit', to: 'ecloud#bs_update' + post 'ecloud/bs_update', to: 'ecloud#bs_update' post 'ecloud/ps_new', to: 'ecloud#ps_new' - post 'ecloud/ps_edit', to: 'ecloud#ps_update' + post 'ecloud/ps_update', to: 'ecloud#ps_update' resources :ec_course_evaluations do