add option for dep_dns
This commit is contained in:
parent
24b9f4015b
commit
3f9cdec426
|
@ -28,17 +28,18 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
|
|||
Resque.enqueue(SendAskReplyMail, @ask_reply.ask_question.id)
|
||||
end
|
||||
##
|
||||
send_request(@ask_question, @ask_reply) if params[:ask_reply][:status] == '轉介其他單位'
|
||||
send_request("http://localhost:4000", @ask_question, @ask_reply) if params[:ask_reply][:status] == '轉介其他單位'
|
||||
##
|
||||
redirect_to panel_ask_back_end_ask_questions_path, notice: t('ask.reply_success')
|
||||
end
|
||||
|
||||
def send_request(current_question, current_reply)
|
||||
def send_request(dep_dns, current_question, current_reply)
|
||||
require 'net/http'
|
||||
require 'uri'
|
||||
require 'json'
|
||||
|
||||
uri = URI.parse("http://localhost:4000/panel/ask/back_end/ask_requests/auth_request")
|
||||
uri_path = "/panel/ask/back_end/ask_requests/auth_request"
|
||||
uri = URI.parse(dep_dns + uri_path)
|
||||
|
||||
body = {
|
||||
'auth_token' => '3kjlfksjDFJ'
|
||||
|
@ -51,7 +52,8 @@ class Panel::Ask::BackEnd::AskRepliesController < OrbitBackendController
|
|||
puts "Response #{response.code} #{response.message}: #{response.body}"
|
||||
|
||||
if response.code == "200"
|
||||
uri = URI.parse("http://localhost:4000/panel/ask/back_end/ask_requests/transfer_request")
|
||||
uri_path = "/panel/ask/back_end/ask_requests/transfer_request"
|
||||
uri = URI.parse(dep_dns + uri_path)
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
request = Net::HTTP::Post.new(uri.request_uri)
|
||||
body = {
|
||||
|
|
Loading…
Reference in New Issue