diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 9d7beb6c1..4720210e3 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -191,7 +191,7 @@ class MemosController < ApplicationController tip_exception("话题名称不能为空") if params[:subject].blank? tip_exception("话题内容不能为空") if params[:content].blank? tip_exception("话题类型不能为空") if params[:forum_id].blank? - tip_exception("技术标签不能为空") if params[:tags].blank? + tip_exception("技术标签不能为空") if params[:forum_id].to_i == 5 && params[:tags].blank? end end diff --git a/app/decorators/course_decorator.rb b/app/decorators/course_decorator.rb index 9c76b058a..9c3340bbf 100644 --- a/app/decorators/course_decorator.rb +++ b/app/decorators/course_decorator.rb @@ -1,5 +1,5 @@ module CourseDecorator def can_visited? - is_public == 1 || User.current.admin? || User.current.member_of_course?(self) + is_public == 1 || User.current.admin_or_business? || User.current.member_of_course?(self) end end \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7e9fd652b..099d45406 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -62,15 +62,18 @@ module ApplicationHelper # shixun开启挑战对应的行为名及url def task_operation_url current_myshixun, shixun - url = "/shixuns/#{shixun.identifier}/shixun_exec" - name = - if current_myshixun.blank? - shixun.status == 0 ? "模拟实战" : "开启挑战" - elsif current_myshixun.status == 1 - "查看实战" + if current_myshixun.blank? + name = shixun.status == 0 ? "模拟实战" : "开启挑战" + url = "/shixuns/#{shixun.identifier}/shixun_exec" + else + identifier = current_myshixun.current_task(current_myshixun.games).try(:identifier) + if current_myshixun.status == 1 + name = "查看实战" else - "继续挑战" + name = "继续挑战" end + url = identifier + end [name, url] end diff --git a/public/react/src/modules/message/js/MessagSub.js b/public/react/src/modules/message/js/MessagSub.js index 8f27b16d0..ef0d35dd1 100644 --- a/public/react/src/modules/message/js/MessagSub.js +++ b/public/react/src/modules/message/js/MessagSub.js @@ -127,6 +127,7 @@ class MessagSub extends Component{ // 账号管理页-认证信息 return window.open("/account/certification") } + return ; case "CancelUserAuthentication" : // 账号管理页-认证信息 return window.open("/account/certification") @@ -142,6 +143,7 @@ class MessagSub extends Component{ // 账号管理页/account/profile return window.open("/account/profile") } + return ; case "ApplyAddSchools" : if(item.tiding_type==="Apply"){ // 单位审批 @@ -151,6 +153,7 @@ class MessagSub extends Component{ // 账号管理页 return window.open("/account/profile") } + return ; case "ApplyAction" : switch (item.parent_container_type) { case "ApplyShixun" : @@ -181,6 +184,7 @@ class MessagSub extends Component{ return window.open("/account/profile") } } + return ; case 'JoinCourse' : // 课堂详情页 :id = return window.open(`/courses/${item.belong_container_id}/teachers`) @@ -256,7 +260,10 @@ class MessagSub extends Component{ } case "Memo" : // 交流问答页 :id = parent_container_id - return window.open(`/forums/${item.parent_container_id}`) + return window.open(`/forums/${item.parent_container_id}`); + case "Message" : + // 交流问答页 :id = parent_container_id + return window.open(`/forums/`); case "Watcher" : // 用户个人中心页 :id = item.trigger_user.login return window.open(`/users/${item.trigger_user.login}/courses`) @@ -446,6 +453,9 @@ class MessagSub extends Component{ return window.open(`/moop_cases/${item.container_id}`) } case "ProjectPackage" : + if(item.tiding_type==="Destroyed"){ + return ; + } if(item.tiding_type==="Destroyed_end"){ return ; }else { @@ -529,6 +539,9 @@ class MessagSub extends Component{ if(item.tiding_type==="Destroyed_end"){ boolps=false; } + if(item.tiding_type==="Destroyed"){ + boolps=false; + } } if(item.container_type==="Course"){ if(item.tiding_type==="Delete"){