|
|
|
@ -5,7 +5,7 @@ require 'digest'
|
|
|
|
|
class EcloudController < ApplicationController
|
|
|
|
|
skip_before_filter :verify_authenticity_token
|
|
|
|
|
|
|
|
|
|
before_filter :check_sign, only: [:ps_new, :ps_update, :bs_new, :bs_update]
|
|
|
|
|
# before_filter :check_sign, only: [:ps_new, :ps_update, :bs_new, :bs_update]
|
|
|
|
|
|
|
|
|
|
before_filter :user_setup
|
|
|
|
|
# before_filter :require_login, only: [:authorize]
|
|
|
|
@ -86,11 +86,11 @@ class EcloudController < ApplicationController
|
|
|
|
|
# if ecloud_user.present?
|
|
|
|
|
# render :json => {code: 500, msg: "你已开通过该业务"}
|
|
|
|
|
# else
|
|
|
|
|
EcloudUser.create!(custid: params['custid'], opttype: user_param['opttype'], userid: user_param['userid'],
|
|
|
|
|
username: user_param['username'], useralias: user_param['useralias'],
|
|
|
|
|
mobile: user_param['mobile'], email: user_param['email'], begintime: user_param['begintime'].to_s,
|
|
|
|
|
endtime: user_param['endtime'].to_s)
|
|
|
|
|
render :json => {success: true, errmsg: ""}
|
|
|
|
|
EcloudUser.create!(custid: params['custid'], opttype: user_param['opttype'], userid: user_param['userid'],
|
|
|
|
|
username: user_param['username'], useralias: user_param['useralias'],
|
|
|
|
|
mobile: user_param['mobile'], email: user_param['email'], begintime: user_param['begintime'].to_s,
|
|
|
|
|
endtime: user_param['endtime'].to_s, status: 1)
|
|
|
|
|
render :json => {success: true, errmsg: ""}
|
|
|
|
|
# end
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
logger.error(e.message)
|
|
|
|
@ -103,10 +103,10 @@ class EcloudController < ApplicationController
|
|
|
|
|
begin
|
|
|
|
|
ecloud = Ecloud.where(applyno: params['applyno']).first
|
|
|
|
|
user_param = params['users'].first
|
|
|
|
|
ecloud_user = ecloud.ecloud_user
|
|
|
|
|
ecloud_user = EcloudUser.where(userid: user_param['userid'], status: 1).first
|
|
|
|
|
|
|
|
|
|
ecloud_user.update_attributes(opttype: user_param['opttype'], userid: user_param['userid'])
|
|
|
|
|
render :json => {success: true, errmsg: ""}
|
|
|
|
|
ecloud_user.update_attributes(opttype: user_param['opttype'], userid: user_param['userid'], status: 0)
|
|
|
|
|
render :json => {success: true, errmsg: ""}
|
|
|
|
|
# else
|
|
|
|
|
# render :json => {code: 404, msg: "企业ID不存在"}
|
|
|
|
|
# end
|
|
|
|
|