去掉实名和职业认证

video_transcode
cxt 5 years ago
parent e51c63f48c
commit fe6a0fc246

@ -95,13 +95,13 @@ class ApplicationController < ActionController::Base
check_account
tip_exception(@course.excellent ? 410 : 409, "您没有权限进入")
end
if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT && @course.tea_id != current_user.id
# 实名认证和职业认证的身份判断
tip_exception(411, "你的实名认证和职业认证审核未通过") if @course.authentication &&
@course.professional_certification && (!current_user.authentication && !current_user.professional_certification)
tip_exception(411, "你的实名认证审核未通过") if @course.authentication && !current_user.authentication
tip_exception(411, "你的职业认证审核未通过") if @course.professional_certification && !current_user.professional_certification
end
# if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT && @course.tea_id != current_user.id
# # 实名认证和职业认证的身份判断
# tip_exception(411, "你的实名认证和职业认证审核未通过") if @course.authentication &&
# @course.professional_certification && (!current_user.authentication && !current_user.professional_certification)
# tip_exception(411, "你的实名认证审核未通过") if @course.authentication && !current_user.authentication
# tip_exception(411, "你的职业认证审核未通过") if @course.professional_certification && !current_user.professional_certification
# end
uid_logger("###############user_course_identity:#{@user_course_identity}")
end

@ -153,8 +153,8 @@ class CoursesController < ApplicationController
begin
ActiveRecord::Base.transaction do
@course = Course.new(name: params[:name], class_period: params[:class_period], credit: params[:credit],
end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id,
authentication: params[:authentication], professional_certification: params[:professional_certification])
end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id)
# authentication: params[:authentication], professional_certification: params[:professional_certification])
@course.tea_id = current_user.id
if params[:subject_id].blank?
@ -219,8 +219,8 @@ class CoursesController < ApplicationController
extra_params[:is_end] = 1
end
extra_params[:authentication] = params[:authentication]
extra_params[:professional_certification] = params[:professional_certification]
# extra_params[:authentication] = params[:authentication]
# extra_params[:professional_certification] = params[:professional_certification]
if @course.subject
@course.start_date = params[:start_date]
@ -1157,10 +1157,10 @@ class CoursesController < ApplicationController
return normal_status(-1, "课堂已结束,无法加入") if course.is_end
# 实名认证和职业认证的身份判断
return normal_status(-2, "该课堂要求成员完成实名和职业认证") if course.authentication &&
course.professional_certification && (!current_user.authentication && !current_user.professional_certification)
return normal_status(-2, "该课堂要求成员完成实名认证") if course.authentication && !current_user.authentication
return normal_status(-2, "该课堂要求成员完成职业认证") if course.professional_certification && !current_user.professional_certification
# return normal_status(-2, "该课堂要求成员完成实名和职业认证") if course.authentication &&
# course.professional_certification && (!current_user.authentication && !current_user.professional_certification)
# return normal_status(-2, "该课堂要求成员完成实名认证") if course.authentication && !current_user.authentication
# return normal_status(-2, "该课堂要求成员完成职业认证") if course.professional_certification && !current_user.professional_certification
# 身份验证
if params[:professor].blank? && params[:assistant_professor].blank? && params[:student].blank?
@ -1452,6 +1452,7 @@ class CoursesController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def course_params
params.require(:course).permit(:name, :class_period, :credit, :end_date, :is_public, :authentication, :professional_certification)
# params.require(:course).permit(:name, :class_period, :credit, :end_date, :is_public, :authentication, :professional_certification)
end
def validate_course_name

Loading…
Cancel
Save