Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_admin
杨树明 6 years ago
commit d7e6fffe2d

@ -69,7 +69,7 @@ class Users::UpdateAccountService < ApplicationService
end
def sms_notify_admin name
Educoder::Sms.send(mobile:'18175896138', send_type:'teacher_register', name: name, user_name:'管理员')
Educoder::Sms.send(mobile:'17680641960', send_type:'teacher_register', name: name, user_name:'管理员')
rescue => ex
Util.logger_error(ex)
end

@ -39,27 +39,22 @@ module Educoder
params['text'] = "【Edu实训】" + code + "手机验证码有效期为10分钟。如非本人操作请忽略。"
elsif send_type == 'competition_start'
params['text'] = "【Edu实训】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛"
Rails.logger.info "#{params['text']}"
elsif send_type == "teacher_register"
params['mobile'] = EduSetting.get('teacher_register_phone') || '17680641960'
params['text'] = "【Edu实训】亲爱的#{user_name},有新的老师#{name}注册啦,请尽快处理"
elsif send_type == 'subject_authorization' || send_type == 'shixun_authorization'
params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{name}#{send_type=='subject_authorization'?'':''}发布申请#{result},请登录平台查看详情"
Rails.logger.info "#{params['text']}"
elsif send_type == 'authentication_pro' || send_type == 'authentication'|| send_type == 'trial_authorization' || send_type == 'project_info'
params['text'] = "【Edu实训】亲爱的#{user_name},您提交的#{send_type == 'authentication_pro'?'':(send_type == 'authentication'? '' : (send_type == 'project_info'?'':'' ))}#{result},请登录平台查看详情"
Rails.logger.info "#{params['text']}"
elsif send_type == "apply_pro_certification" || send_type == "apply_auth"
params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'apply_pro_certification'?'':''}认证申请,请尽快处理"
Rails.logger.info "#{params['text']}"
elsif send_type == "publish_subject" ||send_type == "publish_shixun"|| send_type == "user_apply_auth" || send_type == "discuss"
params['mobile'] = EduSetting.get('subject_shixun_notify_phone') || '18711011226' if send_type == "publish_subject" || send_type == "publish_shixun"
params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'publish_subject'?'':(send_type == 'publish_shixun' ? '' : (send_type == 'discuss' ? '':''))}申请发布,请尽快处理"
Rails.logger.info "#{params['text']}"
elsif send_type == 'join_course_multi_role'
params['text'] = "【Edu实训】亲爱的#{user_name},您的课堂#{name}有助教或者教师申请加入,请尽快审核"
Rails.logger.info "#{params['text']}"
elsif send_type == 'applied_project_info'
params['text'] = "【Edu实训】亲爱的#{user_name},您的项目#{name}有成员申请加入,请尽快审核"
Rails.logger.info "#{params['text']}"
end
http = Net::HTTP.new(send_tpl_sms_uri.host, send_tpl_sms_uri.port)

@ -114,16 +114,15 @@ class NewHeader extends Component {
//
// }
}
openNotification = (messge) => {
notification.open({
message: "提示",
description:
messge,
onClick: () => {
console.log('Notification Clicked!');
},
});
};
componentWillReceiveProps(newProps, oldProps) {
this.setState({
user:newProps.user
@ -408,59 +407,62 @@ submittojoinclass=(value)=>{
return
}
if(value===0){
let url="/courses/join_course_multi_role.json"
const form = new FormData();
form.append('invite_code', tojoinclasstitle);
form.append('role', pamst);
form.append('type', 1);
axios.post(url,form,[true]
).then((response) => {
if( response.data.state===0){
this.submitstatevalue(0,"加入成功",response.data.course_id)
}else if( response.data.state===1){
}else if( response.data.state===2){
this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)")
}else if( response.data.state===3){
this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id)
}else if( response.data.state===4){
this.submitstatevalue( 0,"您输入的邀请码错误)")
}else if( response.data.state===5){
this.submitstatevalue( 0,"您还未登录")
}else if( response.data.state===6){
this.submitstatevalue( 0,"申请已提交,请等待审核")
}else if( response.data.state===7){
this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待")
}else if( response.data.state===8){
this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id)
}else if( response.data.state==9){
this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id)
}else if( response.data.state==10){
this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id)
}else if( response.data.state==11){
this.submitstatevalue(0," 该课堂已归档,请联系老师")
}else if( response.data.state==12){
this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师")
}else if( response.data.state==13){
this.submitstatevalue(0,"您申请已提交,请等待审核")
}else if( response.data.state==14){
this.submitstatevalue("此邀请码已停用,请与老师联系")
}else if( response.data.state==15){
this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行")
}else {
this.submitstatevalue(0," 未知错误,请稍后再试")
}
})
}
// if(value===0){
// let url="/courses/join_course_multi_role.json"
// const form = new FormData();
// form.append('invite_code', tojoinclasstitle);
// form.append('role', pamst);
// form.append('type', 1);
// axios.post(url,form,[true]
// ).then((response) => {
// if( response.data.state===0){
// this.submitstatevalue(0,"加入成功",response.data.course_id)
// }else if( response.data.state===1){
// }else if( response.data.state===2){
// this.submitstatevalue( 0,"课堂已过期! 请联系课堂管理员重启课堂。(在配置课堂处)")
// }else if( response.data.state===3){
// this.submitstatevalue( 0,"您已是课堂成员)",response.data.course_id)
// }else if( response.data.state===4){
// this.submitstatevalue( 0,"您输入的邀请码错误)")
// }else if( response.data.state===5){
// this.submitstatevalue( 0,"您还未登录")
// }else if( response.data.state===6){
// this.submitstatevalue( 0,"申请已提交,请等待审核")
// }else if( response.data.state===7){
// this.submitstatevalue( 0," 您已经发送过申请了,请耐心等待")
// }else if( response.data.state===8){
// this.submitstatevalue( 0,"您已经是该课堂的教师了",response.data.course_id)
// }else if( response.data.state==9){
// this.submitstatevalue( 0,"您已经是该课堂的教辅了",response.data.course_id)
// }else if( response.data.state==10){
// this.submitstatevalue(0,"您已经是该课堂的管理员了",response.data.course_id)
// }else if( response.data.state==11){
// this.submitstatevalue(0," 该课堂已归档,请联系老师")
// }else if( response.data.state==12){
// this.submitstatevalue(0,"您已经发送过申请了,请耐心等待师")
// }else if( response.data.state==13){
// this.submitstatevalue(0,"您申请已提交,请等待审核")
// }else if( response.data.state==14){
// this.submitstatevalue("此邀请码已停用,请与老师联系")
// }else if( response.data.state==15){
// this.submitstatevalue(0,"您已是课堂成员! 加入分班请在课堂具体分班页面进行")
// }else {
// this.submitstatevalue(0," 未知错误,请稍后再试")
// }
// })
//
// }
if(value===1){
let url="/api/applied_project/applied_project_info.json"
const form = new FormData();
form.append('invite_code', tojoinclasstitle);
form.append('member', RadioGroupvalue);
form.append('type', 1);
axios.post(url,form,[true]
let url="/project_applies.json"
// const form = new FormData();
// form.append('code', tojoinclasstitle);
// form.append('role', RadioGroupvalue);
// form.append('type', 1);
axios.post(url,{
code:tojoinclasstitle,
role:RadioGroupvalue
}
).then((response) => {
if( response.data.status===1){
this.submitstatevalue(1,"您输入的邀请码错误")
@ -474,9 +476,17 @@ submittojoinclass=(value)=>{
this.submitstatevalue( 1,"您已经申请加入该项目了,请耐心等待")
}else if( response.data.status===6){
this.submitstatevalue( 1,"您已成功加入项目",response.data.project)
}
}else if( response.data.status===0){
if(RadioGroupvalue==="reporter"){
this.openNotification("您加入项目成功!");
window.location.href=`/projects/${response.data.project_id}`;
}else{
this.openNotification("您的申请已提交,请等待项目管理员审批!");
}
}
})
}
this.hidetojoinclass()
}
// trialapplications =()=>{
@ -869,9 +879,9 @@ submittojoinclass=(value)=>{
{/* /courses/join_course_multi_role */}
{/*<li>*/}
<a onClick={this.tojoinitem}>加入项目</a>
<a onClick={this.tojoinitem}>加入项目</a>
{/*</li>*/}
<Modal
{tojoinitemtype===true?<Modal
keyboard={false}
title="加入项目"
visible={tojoinitemtype}
@ -896,15 +906,15 @@ submittojoinclass=(value)=>{
<label className="panel-form-label fl">身份</label>
<RadioGroup className="mt10" onChange={this.onChangeRadioGroup}>
<Radio value={1}>管理人员</Radio>
<Radio value={2}>开发人员</Radio>
<Radio value={3}>报告人员</Radio>
<Radio value={"manager"}>管理人员</Radio>
<Radio value={"developer"}>开发人员</Radio>
<Radio value={"reporter"}>报告人员</Radio>
</RadioGroup>
</li>
<p id="none_checked_notice" className="color-orange none f12"
style={{marginLeft: '90px',display:checked_notice===true?'block':"none"}}>至少选择一个身份</p>
style={{marginLeft: '90px',display:checked_notice===true?'block':"none"}}>选择一个身份</p>
<li className="clearfix mt10 edu-txt-center">
<a className="task-btn mr10"
@ -917,7 +927,7 @@ submittojoinclass=(value)=>{
</ul>
</div>
</div>
</Modal>
</Modal>:""}
</ul>
</div>
</div>

Loading…
Cancel
Save