fix error

This commit is contained in:
邱博亞 2023-05-08 23:20:15 +08:00
parent ee827ff711
commit 6bf0bfd6bd
1 changed files with 2 additions and 3 deletions

View File

@ -119,20 +119,19 @@ class Admin::RegisterApiController < ApplicationController
end end
success_flag = (response.code == '200') success_flag = (response.code == '200')
rescue => e rescue => e
puts ['e0', e, e.backtrace]
end end
if success_flag if success_flag
return response return response
else else
uri = URI("https://#{params[:site_domain]}/store/confirmation") uri = URI("https://#{params[:site_domain]}/store/confirmation")
response = Net::HTTP.start(uri.host, uri.port,:use_ssl => uri.scheme == 'https',open_timeout: 10,read_timeout: 10,verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http| response = Net::HTTP.start(uri.host, uri.port,:use_ssl => uri.scheme == 'https',open_timeout: 10,read_timeout: 10,verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http|
request = Net::HTTP::Post.new uri
request.set_form_data(params_to_send)
http.request request http.request request
end #if response.code == 301 or http not available,use https to resend /store/confirmation end #if response.code == 301 or http not available,use https to resend /store/confirmation
return response return response
end end
rescue => e rescue => e
puts ['e', e, e.backtrace] puts ['e1', e, e.backtrace]
params[:success] = 'error' params[:success] = 'error'
end end
end end