diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1039a648a..6d5688078 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -28,9 +28,9 @@ module ApplicationHelper end # MD5加密 - def base64_encode(content) + def url_base64_encode(content) return nil if content.blank? - Base64.encode64(content) + Base64.urlsafe_encode64(content) end def graduation_navigation graduation diff --git a/app/views/users/videos/_video.json.jbuilder b/app/views/users/videos/_video.json.jbuilder index ac030ce12..707c0a5cf 100644 --- a/app/views/users/videos/_video.json.jbuilder +++ b/app/views/users/videos/_video.json.jbuilder @@ -1,6 +1,6 @@ json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_id, :transcoded -json.play_url base64_encode(video.play_url) -json.file_url base64_encode(video.file_url) +json.play_url url_base64_encode(video.play_url) +json.file_url url_base64_encode(video.file_url) json.play_duration video.video_play_duration json.published_at video.display_published_at json.created_at video.display_created_at