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
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

@ -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

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

@ -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"){

Loading…
Cancel
Save