视频删除功能

Adjustreact
daiao 5 years ago
parent 4798bf9beb
commit 029e460ee3

@ -112,7 +112,7 @@ class CoursesController < ApplicationController
def delete_course_video
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, "...") unless (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