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

dev_oauth
杨树林 6 years ago
commit d5738980a8

@ -906,15 +906,17 @@ class CoursesController < ApplicationController
# 邀请码验证
return normal_status(-1, "邀请码不能为空") if params[:invite_code].blank?
invite_code = params[:invite_code]
course = Course.find_by(invite_code: invite_code, is_delete: 0, invite_code_halt: 0, is_end: 0)
course = Course.find_by(invite_code: invite_code, is_delete: 0, invite_code_halt: 0)
course_group = CourseGroup.find_by(invite_code: invite_code)
if course.blank?
return normal_status(-1, "邀请码无效") if course_group.blank?
course = Course.find_by(id: course_group.course_id, is_delete: 0, invite_code_halt: 0, is_end: 0)
course = Course.find_by(id: course_group.course_id, is_delete: 0, invite_code_halt: 0)
return normal_status(-1, "邀请码无效") if course.blank?
end
return normal_status(-1, "课堂已结束,无法加入") if course.is_end
# 实名认证和职业认证的身份判断
return normal_status(-1, "该课堂要求成员完成实名和职业认证") if course.authentication &&
course.professional_certification && (!current_user.authentication || !current_user.professional_certification)

@ -85,6 +85,16 @@ class SubjectsController < ApplicationController
# 合作团队
@shixuns = @subject.shixuns.published.pluck(:id)
@courses = @subject.courses if @subject.excellent
@members = @subject.subject_members.includes(:user)
shixuns = @subject.shixuns.published.pluck(:id)
challenge_ids = Challenge.where(shixun_id: shixuns).pluck(:id)
# 实训路径中的所有实训标签
@tags = ChallengeTag.where(challenge_id: challenge_ids).pluck(:name).uniq
# 用户获取的实训标签
# @user_tags = @subject.shixuns.map(&:user_tags_name).flatten.uniq
@user_tags = user_shixun_tags challenge_ids, @user.id
@my_subject_progress = @subject.my_subject_progress
# 访问数变更
@subject.increment!(:visits)
end
@ -149,7 +159,7 @@ class SubjectsController < ApplicationController
end
def choose_subject_shixun
@search = params[:search]
@search = params[:search].strip if params[:search]
@type = params[:type]
# 超级管理员用户显示所有未隐藏的实训、非管理员显示合作团队用户的实训(对本单位公开且未隐藏)
if current_user.admin?
@ -163,8 +173,9 @@ class SubjectsController < ApplicationController
tag_ids = @shixuns.joins(:shixun_tag_repertoires).pluck(:tag_repertoire_id).uniq
@tags = TagRepertoire.select([:id, :name]).where(id: tag_ids)
if params[:search]
@shixuns = @shixuns.where("name like ?", "%#{@search}%")
unless params[:search].blank?
@shixuns = @shixuns.joins(:user).where("shixuns.name like ? or concat(users.lastname, users.firstname) like ?",
"%#{@search}%", "%#{@search}%").distinct
end
unless @type.nil? || @type == "" || @type == "all"

@ -23,4 +23,26 @@ if @subject.excellent
json.course_identity @user.course_identity(course)
json.course_status subject_course_status course
end
end
json.members @members do |member|
json.partial! 'subject_member', locals: { user: member.user }
json.role member.role
end
# 技能标签
json.tags @tags do |tag|
unless tag.blank?
json.tag_name tag
json.status @user_tags.include?(tag)
end
end
# 我的进展
json.progress do
json.my_score @subject.my_subject_score
json.all_score @subject.all_score
json.learned @subject.my_subject_progress
json.time @subject.my_consume_time
end

@ -449,7 +449,7 @@ class DetailCardsEditAndAdd extends Component{
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
{
ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
return(

@ -81,6 +81,7 @@ class DetailCardsEditAndEdit extends Component{
//打开选择实训弹框初始化tag标签和列表
changeTag(id,search){
this.setState({
ChooseShixunListshixun_list:[],
page:1,
@ -481,7 +482,7 @@ class DetailCardsEditAndEdit extends Component{
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
{
ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
return(

@ -43,6 +43,8 @@ function doCreateUploader (options) {
retryDuration: $('#retryDuration').val() || 2,
region: $('#region').val() || 'ap-southeast-1',
userId: $('#userId').val() || 1829848226361863, // 1303984639806000,
// 解决取消上传后无法继续上传同文件的问题
// https://workorder.console.aliyun.com/console.htm#/ticket/detail/?ticketId=FLASELR
enableUploadProgress: false,
// 添加文件成功
addFileSuccess: function (uploadInfo) {

Loading…
Cancel
Save