fix error
This commit is contained in:
parent
e4ac28c1da
commit
d5fe077a26
|
@ -112,15 +112,21 @@ class Admin::RegisterApiController < ApplicationController
|
|||
http = Net::HTTP.new(uri.host,uri.port)
|
||||
request = Net::HTTP::Post.new("/store/confirmation")
|
||||
request.body = params_to_send.to_query
|
||||
begin
|
||||
success_flag = false
|
||||
begin
|
||||
response = http.request(request)
|
||||
if response.code == '200'
|
||||
success_flag = (response.code == '200')
|
||||
rescue => e
|
||||
end
|
||||
if success_flag
|
||||
return response
|
||||
else
|
||||
response = Net::HTTP.post_form(URI("https://#{params[:site_domain]}/store/confirmation"),params_to_send) #if response.code == 301,use https to resend /store/confirmation
|
||||
return response
|
||||
end
|
||||
rescue
|
||||
rescue => e
|
||||
puts ['e', e, e.backtrace]
|
||||
params[:success] = 'error'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue