|
|
|
@ -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
|
|
|
|
|