From 5d1b015b51512626cacce69b868776d17813f65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 31 Jul 2019 18:00:07 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/NewHeader.js | 115 +++++++++++----------- 1 file changed, 58 insertions(+), 57 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 537489f8f..160128f77 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,58 +407,58 @@ 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" + let url="/api/applied_projects.json" const form = new FormData(); - form.append('invite_code', tojoinclasstitle); - form.append('member', RadioGroupvalue); - form.append('type', 1); + form.append('code', tojoinclasstitle); + form.append('role', RadioGroupvalue); + // form.append('type', 1); axios.post(url,form,[true] ).then((response) => { if( response.data.status===1){ @@ -474,7 +473,9 @@ submittojoinclass=(value)=>{ this.submitstatevalue( 1,"您已经申请加入该项目了,请耐心等待") }else if( response.data.status===6){ this.submitstatevalue( 1,"您已成功加入项目",response.data.project) - } + }else if( response.data.status===0){ + this.openNotification("加入项目成功!"); + } }) } } @@ -869,7 +870,7 @@ submittojoinclass=(value)=>{ {/* /courses/join_course_multi_role */} {/*<li>*/} - <a onClick={this.tojoinitem}>加入项目</a> + <a onClick={this.tojoinitem}>加入项目</a> {/*</li>*/} <Modal keyboard={false} @@ -896,9 +897,9 @@ 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> From 649b6f7b2c96264a9c56ccdd2a15545843d74528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 31 Jul 2019 18:20:54 +0800 Subject: [PATCH 2/7] b --- public/react/src/modules/tpm/NewHeader.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 160128f77..ba502df7b 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -455,11 +455,14 @@ submittojoinclass=(value)=>{ if(value===1){ let url="/api/applied_projects.json" - const form = new FormData(); - form.append('code', tojoinclasstitle); - form.append('role', RadioGroupvalue); + // const form = new FormData(); + // form.append('code', tojoinclasstitle); + // form.append('role', RadioGroupvalue); // form.append('type', 1); - axios.post(url,form,[true] + axios.post(url,{ + code:tojoinclasstitle, + role:RadioGroupvalue + } ).then((response) => { if( response.data.status===1){ this.submitstatevalue(1,"您输入的邀请码错误") From 058bc1d45baf1254df18b3dd7fa74b8dc266f9bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 31 Jul 2019 18:22:22 +0800 Subject: [PATCH 3/7] b --- public/react/src/modules/tpm/NewHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index ba502df7b..254ca7566 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -454,7 +454,7 @@ submittojoinclass=(value)=>{ // } if(value===1){ - let url="/api/applied_projects.json" + let url="/api/project_applies.json" // const form = new FormData(); // form.append('code', tojoinclasstitle); // form.append('role', RadioGroupvalue); From e3c73014cb09c57071dd7545ed085606f7f72d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 31 Jul 2019 18:26:59 +0800 Subject: [PATCH 4/7] b --- public/react/src/modules/tpm/NewHeader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 254ca7566..9ff819c66 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -454,7 +454,7 @@ submittojoinclass=(value)=>{ // } if(value===1){ - let url="/api/project_applies.json" + let url="/project_applies.json" // const form = new FormData(); // form.append('code', tojoinclasstitle); // form.append('role', RadioGroupvalue); From 884701144a72a11677e7d421e9b605ea3894b2f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 31 Jul 2019 18:35:36 +0800 Subject: [PATCH 5/7] b --- public/react/src/modules/tpm/NewHeader.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 9ff819c66..45e4acc4a 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -478,9 +478,11 @@ submittojoinclass=(value)=>{ this.submitstatevalue( 1,"您已成功加入项目",response.data.project) }else if( response.data.status===0){ this.openNotification("加入项目成功!"); + window.location.href(`/projects/${response.data.project_id}`) } }) } + this.hidetojoinclass() } // trialapplications =()=>{ @@ -908,7 +910,7 @@ submittojoinclass=(value)=>{ </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" From 557dc146a543f701d0b2b82d62b1ae1a8aceee18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 31 Jul 2019 19:02:15 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/NewHeader.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 45e4acc4a..2c07bc744 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -477,8 +477,12 @@ submittojoinclass=(value)=>{ }else if( response.data.status===6){ this.submitstatevalue( 1,"您已成功加入项目",response.data.project) }else if( response.data.status===0){ - this.openNotification("加入项目成功!"); - window.location.href(`/projects/${response.data.project_id}`) + if(RadioGroupvalue==="reporter"){ + this.openNotification("您加入项目成功!"); + window.location.href=`/projects/${response.data.project_id}`; + }else{ + this.openNotification("您的申请已提交,请等待项目管理员审批!"); + } } }) } @@ -877,7 +881,7 @@ submittojoinclass=(value)=>{ {/*<li>*/} <a onClick={this.tojoinitem}>加入项目</a> {/*</li>*/} - <Modal + {tojoinitemtype===true?<Modal keyboard={false} title="加入项目" visible={tojoinitemtype} @@ -923,7 +927,7 @@ submittojoinclass=(value)=>{ </ul> </div> </div> - </Modal> + </Modal>:""} </ul> </div> </div> From 7ea32a3efbe89dae4a09108ebb5096fd85513e2d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 1 Aug 2019 14:10:26 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E7=9F=AD=E4=BF=A1=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E7=9A=84=E6=89=8B=E6=9C=BA=E5=8F=B7=E5=81=9A=E6=88=90=E5=8F=AF?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/users/update_account_service.rb | 2 +- lib/educoder/sms.rb | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) 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)