diff --git a/app/assets/javascripts/lib/social-share-button.coffee b/app/assets/javascripts/lib/social-share-button.coffee index 8e97d0ef..8a72a2ac 100644 --- a/app/assets/javascripts/lib/social-share-button.coffee +++ b/app/assets/javascripts/lib/social-share-button.coffee @@ -9,7 +9,7 @@ window.SocialShareButton = img = encodeURIComponent($(el).parent().data("img")) fb_url = encodeURIComponent($(el).parent().data("fb_url")) url = encodeURIComponent(location.href) - fb_full_url = encodeURIComponent("#{fb_url}?orig_url=#{location.href}") + fb_full_url = encodeURIComponent("#{fb_url}?orig_host=#{location.host}&orig_path=#{location.pathname}") switch site when "weibo" SocialShareButton.openUrl("http://v.t.sina.com.cn/share/share.php?url=#{url}&pic=#{img}&title=#{title}&content=utf-8") diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bf9da2f7..7601f91a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -110,7 +110,7 @@ class ApplicationController < ActionController::Base def render_share object_class = params[:model].classify.constantize @object = object_class.find(params[:id]) - @orig_url = params[:orig_url] + @orig_url = "http://#{params[:orig_host]}/#{params[:orig_path]}" render 'shared/render_share', :layout => false end diff --git a/app/views/shared/render_share.html.erb b/app/views/shared/render_share.html.erb index 110d30f5..33cc4b00 100644 --- a/app/views/shared/render_share.html.erb +++ b/app/views/shared/render_share.html.erb @@ -2,7 +2,7 @@ - +