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