base64问题

courseware
daiao 5 years ago
parent 8b5b0e9c54
commit 771546b90a

@ -28,9 +28,9 @@ module ApplicationHelper
end
# MD5加密
def edu_md5_encode(content)
def edu_base64_encode(content)
return nil if content.blank?
"https://www.educoder.net/#{Digest::MD5.hexdigest(content)}"
"https://www.educoder.net/#{Base64.encode64(content)}.mp4"
end
def graduation_navigation graduation

@ -1,6 +1,6 @@
json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_id, :transcoded
json.play_url edu_md5_encode(video.play_url)
json.file_url edu_md5_encode(video.file_url)
json.play_url edu_base64_encode(video.play_url)
json.file_url edu_base64_encode(video.file_url)
json.real_play_url video.play_url
json.real_file_url video.file_url
json.play_duration video.video_play_duration

Loading…
Cancel
Save