play_url与file_url加密

dev_aliyun2
daiao 5 years ago
parent c4d2394f66
commit 95f2eb26ee

@ -27,6 +27,11 @@ module ApplicationHelper
sanitize content, tags: tags, attributes: attributes
end
# MD5加密
def md5_encode(content)
Digest::MD5.hexdigest(content)
end
def graduation_navigation graduation
graduation.class.to_s == "GraduationTopic" ? "毕设选题" : "毕设任务"
end

@ -1,4 +1,6 @@
json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_id, :transcoded
json.play_url md5_encode(video.play_url)
json.file_url md5_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

Loading…
Cancel
Save