fix error

This commit is contained in:
邱博亞 2023-05-11 22:02:56 +08:00
parent 51f809f951
commit 2915e7c7a0
1 changed files with 2 additions and 1 deletions

View File

@ -1,7 +1,8 @@
module RegisteredModuleHelper module RegisteredModuleHelper
def install_on_server(site, mod) def install_on_server(site, mod)
mod = "feeds" if mod == "feed" mod = "feeds" if mod == "feed"
params_to_send = {"site_token" => site.site_token, "module_name" => mod.name, "git_path" => mod.git_path, "template" => "http://store.tp.rulingcom.com#{mod.template.url}", "module_key" => mod.module_key,"template_filename" => mod.template.file.filename} current_site = Site.first
params_to_send = {"site_token" => site.site_token, "module_name" => mod.name, "git_path" => mod.git_path, "template" => "#{current_site.root_url}#{mod.template.url}", "module_key" => mod.module_key,"template_filename" => mod.template.file.filename}
uri = URI.parse("http://#{site.site_domain}/") uri = URI.parse("http://#{site.site_domain}/")
http = Net::HTTP.new(uri.host,uri.port) http = Net::HTTP.new(uri.host,uri.port)
request = Net::HTTP::Post.new("/store/install_module") request = Net::HTTP::Post.new("/store/install_module")