Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hs
杨树林 6 years ago
commit b17a1204f8

@ -108,6 +108,7 @@ class ApplicationController < ActionController::Base
def find_course def find_course
return normal_status(2, '缺少course_id参数') if params[:course_id].blank? return normal_status(2, '缺少course_id参数') if params[:course_id].blank?
@course = Course.find(params[:course_id]) @course = Course.find(params[:course_id])
tip_exception(404, "") if @course.is_delete == 1 && !current_user.admin?
rescue Exception => e rescue Exception => e
tip_exception(e.message) tip_exception(e.message)
end end

@ -1178,6 +1178,7 @@ class CoursesController < ApplicationController
# Use callbacks to share common setup or constraints between actions. # Use callbacks to share common setup or constraints between actions.
def set_course def set_course
@course = Course.find_by!(id: params[:id]) @course = Course.find_by!(id: params[:id])
tip_exception(404, "") if @course.is_delete == 1 && !current_user.admin?
end end
# Never trust parameters from the scary internet, only allow the white list through. # Never trust parameters from the scary internet, only allow the white list through.

Loading…
Cancel
Save