From c543779cb1aaac41615d0093b5907e14c4f6d6ae Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Mon, 1 Jul 2019 14:20:48 +0800 Subject: [PATCH] fix bug --- app/helpers/application_helper.rb | 4 ++-- app/templates/exercise_export/exercise_user.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 65b6c0634..6ddbdce0c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -337,7 +337,7 @@ module ApplicationHelper # 导出pdf时,转化markdown为html def to_markdown(text) return nil if text.blank? - request_url = request.base_url + request_url = "http://47.96.87.25:48080" options = { :autolink => true, @@ -350,7 +350,7 @@ module ApplicationHelper } markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,options) m_t = markdown.render(text) - m_t&.include?("src=\"") ? m_t&.gsub("src=\"","src=\"#{request.base_url}") : m_t + m_t&.include?("src=\"") ? m_t&.gsub("src=\"","src=\"#{request_url}") : m_t Rails.logger.info("###########__________request_url_________###################{request_url}") end diff --git a/app/templates/exercise_export/exercise_user.html.erb b/app/templates/exercise_export/exercise_user.html.erb index 3e92c5864..f523246a0 100644 --- a/app/templates/exercise_export/exercise_user.html.erb +++ b/app/templates/exercise_export/exercise_user.html.erb @@ -121,7 +121,7 @@
- <%= q.question_number %>、  + <%= q.question_number %>、 <%= request.base_url %> <%= q.question_type_name %>