视频删除问题

Adjustreact
daiao 5 years ago
parent f044f347e0
commit 4798bf9beb

@ -110,9 +110,9 @@ class CoursesController < ApplicationController
end
def delete_course_video
video = Video.find_by(uuid: params[:video_id])
video = Video.find_by(id: params[:video_id])
tip_exception(404, "找不到资源") if video.blank?
tip_exception(403, "...") if video.user_id != current_user.id || !current_user.admin_or_business?
tip_exception(403, "...") if (video.user_id == current_user.id || current_user.admin_or_business?)
video.destroy!
AliyunVod::Service.delete_video([video.uuid]) rescue nil
render_ok

Loading…
Cancel
Save