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

dev_admin
cxt 6 years ago
commit a85b0e52cf

@ -1,5 +1,5 @@
module CourseDecorator module CourseDecorator
def can_visited? 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
end end

@ -62,15 +62,18 @@ module ApplicationHelper
# shixun开启挑战对应的行为名及url # shixun开启挑战对应的行为名及url
def task_operation_url current_myshixun, shixun def task_operation_url current_myshixun, shixun
url = "/shixuns/#{shixun.identifier}/shixun_exec" if current_myshixun.blank?
name = name = shixun.status == 0 ? "模拟实战" : "开启挑战"
if current_myshixun.blank? url = "/shixuns/#{shixun.identifier}/shixun_exec"
shixun.status == 0 ? "模拟实战" : "开启挑战" else
elsif current_myshixun.status == 1 identifier = current_myshixun.current_task(current_myshixun.games).try(:identifier)
"查看实战" if current_myshixun.status == 1
name = "查看实战"
else else
"继续挑战" name = "继续挑战"
end end
url = identifier
end
[name, url] [name, url]
end end

@ -56,16 +56,17 @@ class ShixunhomeWorkItem extends Component{
startbtn:true, startbtn:true,
}) })
let url= list+".json"; let url= list+".json";
const w=window.open('about:blank');
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status===200){ if(response.status===200){
if(response.data.status===-2){ if(response.data.status===-2){
this.setState({ this.setState({
startbtn:false, startbtn:false,
shixunsreplace:true, shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json" hidestartshixunsreplacevalue:response.data.message+".json"
}) })
w.close()
}else if(response.data.status===-1){ }else if(response.data.status===-1){
console.log(response) console.log(response)
}else if(response.data.status===-3){ }else if(response.data.status===-3){
@ -74,11 +75,9 @@ class ShixunhomeWorkItem extends Component{
startshixunCombattype:true, startshixunCombattype:true,
startbtn:false startbtn:false
}) })
w.close()
}else{ }else{
if(response.data.status!=401&&response.data.status!=403){ if(response.data.status!=401&&response.data.status!=403){
const w=window.open('about:blank');
w.location.href= "/tasks/"+response.data.game_identifier w.location.href= "/tasks/"+response.data.game_identifier
} }
@ -88,6 +87,8 @@ class ShixunhomeWorkItem extends Component{
this.setState({ this.setState({
startbtn:false startbtn:false
}) })
w.close()
}); });
} }

@ -127,6 +127,7 @@ class MessagSub extends Component{
// 账号管理页-认证信息 // 账号管理页-认证信息
return window.open("/account/certification") return window.open("/account/certification")
} }
return ;
case "CancelUserAuthentication" : case "CancelUserAuthentication" :
// 账号管理页-认证信息 // 账号管理页-认证信息
return window.open("/account/certification") return window.open("/account/certification")
@ -142,6 +143,7 @@ class MessagSub extends Component{
// 账号管理页/account/profile // 账号管理页/account/profile
return window.open("/account/profile") return window.open("/account/profile")
} }
return ;
case "ApplyAddSchools" : case "ApplyAddSchools" :
if(item.tiding_type==="Apply"){ if(item.tiding_type==="Apply"){
// 单位审批 // 单位审批
@ -151,6 +153,7 @@ class MessagSub extends Component{
// 账号管理页 // 账号管理页
return window.open("/account/profile") return window.open("/account/profile")
} }
return ;
case "ApplyAction" : case "ApplyAction" :
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "ApplyShixun" : case "ApplyShixun" :
@ -181,6 +184,7 @@ class MessagSub extends Component{
return window.open("/account/profile") return window.open("/account/profile")
} }
} }
return ;
case 'JoinCourse' : case 'JoinCourse' :
// 课堂详情页 :id = // 课堂详情页 :id =
return window.open(`/courses/${item.belong_container_id}/teachers`) return window.open(`/courses/${item.belong_container_id}/teachers`)
@ -256,7 +260,10 @@ class MessagSub extends Component{
} }
case "Memo" : case "Memo" :
// 交流问答页 :id = parent_container_id // 交流问答页 :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" : case "Watcher" :
// 用户个人中心页 :id = item.trigger_user.login // 用户个人中心页 :id = item.trigger_user.login
return window.open(`/users/${item.trigger_user.login}/courses`) 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}`) return window.open(`/moop_cases/${item.container_id}`)
} }
case "ProjectPackage" : case "ProjectPackage" :
if(item.tiding_type==="Destroyed"){
return ;
}
if(item.tiding_type==="Destroyed_end"){ if(item.tiding_type==="Destroyed_end"){
return ; return ;
}else { }else {
@ -529,6 +539,9 @@ class MessagSub extends Component{
if(item.tiding_type==="Destroyed_end"){ if(item.tiding_type==="Destroyed_end"){
boolps=false; boolps=false;
} }
if(item.tiding_type==="Destroyed"){
boolps=false;
}
} }
if(item.container_type==="Course"){ if(item.container_type==="Course"){
if(item.tiding_type==="Delete"){ if(item.tiding_type==="Delete"){

Loading…
Cancel
Save