diff --git a/app/services/users/update_account_service.rb b/app/services/users/update_account_service.rb index b160b47cd..c8ba6da61 100644 --- a/app/services/users/update_account_service.rb +++ b/app/services/users/update_account_service.rb @@ -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 diff --git a/lib/educoder/sms.rb b/lib/educoder/sms.rb index 63287301d..a98ebf493 100644 --- a/lib/educoder/sms.rb +++ b/lib/educoder/sms.rb @@ -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) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index da44b0397..c2b5539fd 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -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 */} {/*
  • */} - 加入项目 + 加入项目 {/*
  • */} - { - 管理人员 - 开发人员 - 报告人员 + 管理人员 + 开发人员 + 报告人员

    请至少选择一个身份

    + style={{marginLeft: '90px',display:checked_notice===true?'block':"none"}}>请选择一个身份

  • { - + :""}