|
|
|
@ -911,6 +911,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
CourseAddStudentCreateWorksJob.perform_later(course.id, [current_user.id])
|
|
|
|
|
StudentJoinCourseNotifyJob.perform_later(current_user.id, course.id)
|
|
|
|
|
end
|
|
|
|
|
student_role = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 创建教师身份
|
|
|
|
@ -940,9 +941,9 @@ class CoursesController < ApplicationController
|
|
|
|
|
teacher_role = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if teacher_role && current_user.student_of_course?(course)
|
|
|
|
|
if teacher_role && student_role
|
|
|
|
|
render json: { status: 0, message: message, course_id: course.id}
|
|
|
|
|
elsif current_user.student_of_course?(course)
|
|
|
|
|
elsif student_role
|
|
|
|
|
render json: { status: 0, message: "加入成功", course_id: course.id}
|
|
|
|
|
else
|
|
|
|
|
normal_status(message)
|
|
|
|
|