fix error

This commit is contained in:
邱博亞 2023-05-08 22:38:15 +08:00
parent e4ac28c1da
commit d5fe077a26
1 changed files with 9 additions and 3 deletions

View File

@ -113,14 +113,20 @@ class Admin::RegisterApiController < ApplicationController
request = Net::HTTP::Post.new("/store/confirmation")
request.body = params_to_send.to_query
begin
response = http.request(request)
if response.code == '200'
success_flag = false
begin
response = http.request(request)
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