From b61bb1310c80b7b52a07fbd7cd9d11ad7dc4a7ac Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sat, 22 Jun 2019 17:41:20 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=88=91=E7=9A=84=E5=AE=9E=E8=AE=AD-images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/GraduationTaskssettinglist.js | 32 +++++++++++-------- .../src/modules/user/usersInfo/InfosShixun.js | 2 +- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 752d61d33..5907674b5 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -1279,6 +1279,9 @@ class GraduationTaskssettinglist extends Component{ text-overflow: ellipsis; white-space: nowrap; } + .ant-table-tbody > tr:last-child > td{ + border:none!important; + } ` } @@ -1545,21 +1548,22 @@ class GraduationTaskssettinglist extends Component{
- {this.props.isAdmin()?{taskslistdata&&taskslistdata.work_count}个检索结果({taskslistdata&&taskslistdata.work_count} 学生) :""} - {this.props.isAdmin()?
-

- - {order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序 -

-
    -
  • this.funorder("updated_at")}>更新时间 -
  • -
  • this.funorder("work_score" )}>最终成绩 -
  • -
  • this.funorder("student_id" )}>学生学号 + {this.props.isAdmin()?{taskslistdata&&taskslistdata.work_count}个检索结果({taskslistdata&&taskslistdata.work_count} 学生) :""} + { + this.props.isAdmin() ? +
    +
  • + {order==="updated_at"?"更新时间":order==="work_score"?"最终成绩":order==="student_id"?"学生学号":""}排序 + +
  • -
-
:""} +
+ :"" + }
diff --git a/public/react/src/modules/user/usersInfo/InfosShixun.js b/public/react/src/modules/user/usersInfo/InfosShixun.js index d6835098a..2a1210faf 100644 --- a/public/react/src/modules/user/usersInfo/InfosShixun.js +++ b/public/react/src/modules/user/usersInfo/InfosShixun.js @@ -171,7 +171,7 @@ class InfosShixun extends Component{ item.tag &&
{item.tag}
} - Shixun6 + Shixun6

From e3e5db246c3716893c767fe96e607ae1fed07348 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 17:47:54 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 1 + .../exercise/Studentshavecompletedthelist.js | 8 +- public/react/src/modules/login/LoginDialog.js | 1175 +++++++++-------- public/react/src/modules/tpm/NewHeader.js | 25 +- 4 files changed, 607 insertions(+), 602 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 94a1f5e44..bd3bb68fa 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -114,6 +114,7 @@ export function initAxiosInterceptors(props) { notification.open({ message:"提示", description: response.data.message || '服务器异常,请联系管理员。', + }); // notification['error']({ // message:"提示", diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 64cfaee64..7d0a0b54e 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -2030,7 +2030,7 @@ class Studentshavecompletedthelist extends Component { //===0 不包括主观题 if (indexi === exercise_users.length) { //都没评论 不显示评论 - if (response.data.poll_types.groups_count > 0) { + if (response.data.exercise_types.groups_count > 0) { // console.log("77771111111"); //分班大于0显示分班 //7ge @@ -2273,7 +2273,7 @@ class Studentshavecompletedthelist extends Component { } else { //已经评论 // response.data.course_groups.length - if (response.data.poll_types.groups_count > 0) { + if (response.data.exercise_types.groups_count > 0) { //显示分班 //8ge this.setState({ @@ -2546,7 +2546,7 @@ class Studentshavecompletedthelist extends Component { //包括主观题 if (indexi === exercise_users.length) { console.log("2548包含主观题不包含分班"); - if (response.data.poll_types.groups_count> 0){ + if (response.data.exercise_types.groups_count> 0){ this.setState({ data: datalist, teacherlist: teacherlist, @@ -2837,7 +2837,7 @@ class Studentshavecompletedthelist extends Component { } } else { console.log("2699包含主观题包含分班"); - if (response.data.poll_types.groups_count> 0) { + if (response.data.exercise_types.groups_count> 0) { this.setState({ data: datalist, teacherlist: teacherlist, diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 28198216c..1dcfd1386 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -1,587 +1,588 @@ -import React, { Component } from 'react'; -import { Redirect } from 'react-router'; - -import Dialog, { - DialogActions, - DialogContent, - DialogContentText, - DialogTitle, -} from 'material-ui/Dialog'; - - -import axios from 'axios'; - -import './LoginDialog.css'; -import { broadcastChannelPostMessage } from 'educoder' - -const $ = window.$; -var wait = 60; -function time(btn){ - if (wait==0) { - $(btn).addClass("btn_orange_bg"); - btn.removeAttribute("disabled"); - btn.innerHTML = "获取验证码"; - wait = 60; - return; - }else{ - $(btn).removeClass("btn_orange_bg"); - btn.setAttribute("disabled", "disabled"); - btn.innerHTML = wait + "s后重试"; - wait--; - } - setTimeout(function(){ - time(btn); - },1000); -} -function get_login_verification_code(btn) { - if($(btn).attr("disabled")) { - return false; - } else { - if (/^1\d{10}$/.test($("#pass_name_input").val()) || /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test($("#pass_name_input").val())){ - if(!window.IsPC() || $('#quick-drag .drag_text').html() == "验证通过") { - $("#passlogin_error_notice").hide(); - btn.setAttribute("disabled", "disabled"); - var val = ''; - var type = 6; - if(/^1\d{10}$/.test($("#pass_name_input").val())){ - type = 6; - } else if(/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test($("#pass_name_input").val())){ - type = 7; - } - $.get( - 'https://www.educoder.net/account/get_verification_code', - { value: $('#pass_name_input').val().trim(), - type: type}, - function (data) { - if (data.status == "2") { - if(type == 6){ - $("#pass_name_input").next().find("p").html("该手机号尚未注册,你可以去注册").show(); - } else{ - $("#pass_name_input").next().find("p").html("该邮箱尚未绑定,你可以登录后去绑定").show(); - } - } else { - $("#pass_name_input").next().find("p").hide(); - if(type == 6){ - $("#send_code_notice").html(data.msg).show(); - } else{ - var uurl = window.gotoEmail(data.link); - $("#send_code_notice").html("验证码已经发送到您的邮箱,去查收").show(); - } - time(btn); - } - }); - } else{ - $("#passlogin_error_notice").show(); - } - } - } -} - - -class LoginDialog extends Component { - constructor(props) { - super(props) - this.state = { - open: true, - login:0, - speedy:1, - regular:0, - loginValue:'', - passValue:'', - isGoing:true, - isGoingValue:1, - disabled:true, - bottonclass:'log-botton mt5', - dialogBox:'dialogBox', - shortcutValue:'', - shortcutnum:1, - disabledType:true, - gaincode:'gain-code', - authCodeType:true, - authCodeclass:'log-botton mt5', - isRender: false, - - }; - } - enter=(num) =>{ - this.setState({login:num,speedy:1,dialogBox:'dialogBox'}); - } - - register=(num) =>{ - this.setState({login:1,speedy:num,dialogBox:'dialogBox2'}); - } - - loginChange = () =>{ - let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; - let reg1 = /^1\d{10}$/; - let reg2=/^[a-zA-z]\w{3,14}$/; - let value=this.refs.loginPassText.value; - let valuenum= value.length; - if(valuenum>0){ - if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){ - this.setState({regular:1}) - return - }else{ - this.setState({loginValue:value}) - this.setState({regular:0}) - } - }else{ - this.setState({loginValue:value}) - } - } - - passwordChange = () =>{ - let value =this.refs.passwordText.value; - - let valuenum= value.length; - this.setState({disabled:false}) - this.setState({bottonclass:'log-botton mt5 edu-back-blue'}) - if(valuenum==0){ - this.setState({bottonclass:'log-botton mt5'}) - this.setState({disabled:true}) - } - this.setState({passValue:value}) - } - - handleInputChange =(event)=> { - const target = event.target; - const value = target.type === 'checkbox' ? target.checked : target.value; - const name = target.name; - - this.setState({[name]:value}) - - if(value===true){ - this.setState({isGoingValue:1}) - }else{ - this.setState({isGoingValue:0}) - } - - } - - // 快捷注册 - shortcutIdChange=()=>{ - let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; - let reg1 = /^1\d{10}$/; - let reg2=/^[a-zA-z]\w{3,14}$/; - let value=this.refs.shortcutText.value; - let valuenum= value.length; - if(valuenum>0){ - if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){ - this.setState({shortcutnum:0}) - this.setState({disabledType:true}) - this.setState({gaincode : 'gain-code'}) - return - }else{ - this.setState({gaincode : 'gain-code edu-back-blue'}) - this.setState({shortcutValue:value}) - this.setState({shortcutnum:1}) - this.setState({disabledType:false}) - } - - - }else{ - this.setState({shortcutValue:value}) - - } - - } - authCodeChange=()=>{ - - let value=this.refs.authCodeText.value; - let valuenum= value.length; - if(valuenum>3){ - this.setState({authCodeType:false}) - this.setState({authCodeclass:'log-botton mt5 edu-back-blue'}) - }else if(valuenum==0){ - this.setState({authCodeType:true}) - this.setState({authCodeclass:'log-botton mt5'}) - } - } - get_login_verification_code=()=>{ - get_login_verification_code($('#get_verification_code')[0]) - } - dragWrapper=() =>{ - const $ = window.$ - $.fn.drag = function(options) { - - var x, drag = this, isMove = false, defaults = { - }; - var options = $.extend(defaults, options); - var handler = drag.find('.handler'); - var drag_bg = drag.find('.drag_bg'); - var text = drag.find('.drag_text'); - var maxWidth = 100 - //鼠标按下时候的x轴的位置 - handler.mousedown(function(e) { - isMove = true; - x = e.pageX - parseInt(handler.css('left'), 10); - maxWidth = drag.width() - handler.width() - 2; //能滑动的最大间距 - }); - $(document).mousemove(function(e) { - var _x = e.pageX - x;// _x = e.pageX - (e.pageX - parseInt(handler.css('left'), 10)) = x - if (isMove) { - - if (_x > 0 && _x <= maxWidth) { - handler.css({'left': _x}); - drag_bg.css({'width': _x}); - } else if (_x > maxWidth) { //鼠标指针移动距离达到最大时清空事件 - dragOk(); - } - } - }).mouseup(function(e) { - isMove = false; - var _x = e.pageX - x; - if (_x < maxWidth) { //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置 - handler.css({'left': 0}); - drag_bg.css({'width': 0}); - } - }); - - //清空事件 - function dragOk() { - handler.removeClass('handler_bg').addClass('handler_ok_bg'); - text.removeClass('slidetounlock').text('验证通过').css({'color':'#fff'}); //modify - // drag.css({'color': '#fff !important'}); - - handler.css({'left': maxWidth}); // add - drag_bg.css({'width': maxWidth}); // add - - handler.unbind('mousedown'); - $(document).unbind('mousemove'); - $(document).unbind('mouseup'); - - } - } - - setTimeout(()=>{ - $('#quick-drag').drag(); - }, 4000) - } - - componentWillReceiveProps(nextProps) { - - this.setState({ - isRender:nextProps.isRender - }) - // console.log(nextProps.isRender); - - } - - componentDidMount() { - - if(this.props.isRender!=undefined){ - this.setState({ - isRender:this.props.isRender - }) - } - - // $(document).on("showLoginDialog", (e, args)=>{ - // this.setState({ - // isRender: true - // }) - // }) - - this.dragWrapper(); - - axios.interceptors.response.use((response) => { - if(response!=undefined) - if (response&&response.data.status === 401) { - this.setState({ - isRender: true - }) - } - return response; - }, (error) => { - // // if (error.response && error.response.data.error === '401 Unauthorized') { - // // this.back_url = window.location.href; - // // this.setState({ - // // isRender: true - // // }) - // // // TODO 这里如果样式变了会出现css不加载的情况 - // // const $ = window.$; - // // const isCssLoaded = window.getComputedStyle($('.log_nav li.active')[0], null) - // // .getPropertyValue('border-bottom') - // // == "2px solid rgb(69, 155, 229)" - // // if (!isCssLoaded) { - // // const isPort3007 = window.location.port == 3007; - // // let _url_origin = isPort3007 ? 'http://localhost:3000' : '' - // // - // // $('head').append( $('') - // // .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css`) ); - // // $('head').append( $('') - // // .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css`) ); - // // } - // // } - // // return Promise.reject(error); - }); - } - handleDialogClose() { - this.setState({ - isRender: false - }) - window.location.href="/"; - } - - loginEDU=()=>{ - let {loginValue,passValue,regular,isGoingValue}=this.state; - if(regular===1){ - return - } - let newloginValue=loginValue.replace(/(^\s*)|(\s*$)/g, ""); - let newpassValue=passValue.replace(/(^\s*)|(\s*$)/g, ""); - - let url='/accounts/login.json' - axios.post(url, { - login:newloginValue, - password:newpassValue, - autologin:isGoingValue - } - ).then((response) => { - if(response===undefined){ - return - } - if(response.status===200){ - if (response.data.status === 402) { - window.location.href = response.data.url; - }else{ - broadcastChannelPostMessage('refreshPage') - this.setState({ - isRender:false - }) - window.location.reload(); - } - } - - }).catch((error) => { - console.log(error) - }) - } - onKeydowns=(e)=>{ - let {disabled}=this.state; - if( disabled===false&& e.keyCode === 13){ - this.loginEDU() - console.log(1) - } - } - render() { - let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass, - dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state; - - if (isRender === undefined) { - isRender = false - } - - return ( -

this.handleDialogClose()} - > -
-
{this.handleDialogClose()}}> - -
- -
-
    -
  • {this.enter(0)}}>登录
  • - {/*
  • {this.register(0)}}>快捷登录
  • */} -
- - -
-
- -
- - -
- - - - -

请输入有效的手机号/邮箱号/用户名

- -
- - -
-

- 请输入密码 -

-
-
- - - {/**/} - -
- 登录 -
- -

- - - - - - - - 忘记密码 - 注册 - - -

- -
-
- - {/*快捷登录*/} - - - -
-
- -
- - ); - } - -} - -export default LoginDialog ; - - -// onkeypress="user_login_keypress(event);" - -// onkeypress="user_login_keypress(event);" - - -{/*
-
-
-

-
-
} - - - -{/*第三方账号登录*/} - -{/*
-

第三方账号登录

-
- - - -
-
} - -// -// {/*
*/} -// {/*
*/} -// {/*
*/} -// {/**/} -// {/**/} -// {/*
*/} -// {/**/} -// {/**/} -// {/**/} -// {/*
*/} -// {/*

请输入有效的手机号/邮箱号*/} -// {/*

*/} -// {/*
*/} -// -// {/*
*/} -// {/*/!*drag*/ }*/} -// {/*
*/} -// {/*
*/} -// {/*
*/} -// {/*请按住滑块,拖动到最右边*/} -// {/*
*/} -// {/*
*/} -// {/*
*/} -// {/*
*/} -// {/*

请先拖动滑块完成验证

*/} -// {/*
*/} -// {/*
*/} -// -// {/*

*/} -// {/**/} -// {/**/} -// {/**/} -// {/*

*/} -// -// {/*
*/} -// {/*

*/} -// {/*请输入验证码*/} -// {/*

*/} -// {/*
*/} -// -// {/**/} -// -// {/*

*/} -// -// {/**/} -// {/**/} -// {/**/} -// {/**/} -// -// {/**/} -// {/*忘记密码*/} -// {/*注册*/} -// {/**/} -// -// {/*

*/} -// {/**/} -// {/*
*/} +import React, { Component } from 'react'; +import { Redirect } from 'react-router'; + +import Dialog, { + DialogActions, + DialogContent, + DialogContentText, + DialogTitle, +} from 'material-ui/Dialog'; + + +import axios from 'axios'; + +import './LoginDialog.css'; +import { broadcastChannelPostMessage } from 'educoder' + +const $ = window.$; +var wait = 60; +function time(btn){ + if (wait==0) { + $(btn).addClass("btn_orange_bg"); + btn.removeAttribute("disabled"); + btn.innerHTML = "获取验证码"; + wait = 60; + return; + }else{ + $(btn).removeClass("btn_orange_bg"); + btn.setAttribute("disabled", "disabled"); + btn.innerHTML = wait + "s后重试"; + wait--; + } + setTimeout(function(){ + time(btn); + },1000); +} +function get_login_verification_code(btn) { + if($(btn).attr("disabled")) { + return false; + } else { + if (/^1\d{10}$/.test($("#pass_name_input").val()) || /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test($("#pass_name_input").val())){ + if(!window.IsPC() || $('#quick-drag .drag_text').html() == "验证通过") { + $("#passlogin_error_notice").hide(); + btn.setAttribute("disabled", "disabled"); + var val = ''; + var type = 6; + if(/^1\d{10}$/.test($("#pass_name_input").val())){ + type = 6; + } else if(/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test($("#pass_name_input").val())){ + type = 7; + } + $.get( + 'https://www.educoder.net/account/get_verification_code', + { value: $('#pass_name_input').val().trim(), + type: type}, + function (data) { + if (data.status == "2") { + if(type == 6){ + $("#pass_name_input").next().find("p").html("该手机号尚未注册,你可以去注册").show(); + } else{ + $("#pass_name_input").next().find("p").html("该邮箱尚未绑定,你可以登录后去绑定").show(); + } + } else { + $("#pass_name_input").next().find("p").hide(); + if(type == 6){ + $("#send_code_notice").html(data.msg).show(); + } else{ + var uurl = window.gotoEmail(data.link); + $("#send_code_notice").html("验证码已经发送到您的邮箱,去查收").show(); + } + time(btn); + } + }); + } else{ + $("#passlogin_error_notice").show(); + } + } + } +} + + +class LoginDialog extends Component { + constructor(props) { + super(props) + this.state = { + open: true, + login:0, + speedy:1, + regular:0, + loginValue:'', + passValue:'', + isGoing:true, + isGoingValue:1, + disabled:true, + bottonclass:'log-botton mt5', + dialogBox:'dialogBox', + shortcutValue:'', + shortcutnum:1, + disabledType:true, + gaincode:'gain-code', + authCodeType:true, + authCodeclass:'log-botton mt5', + isRender: false, + + }; + } + enter=(num) =>{ + this.setState({login:num,speedy:1,dialogBox:'dialogBox'}); + } + + register=(num) =>{ + this.setState({login:1,speedy:num,dialogBox:'dialogBox2'}); + } + + loginChange = () =>{ + let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; + let reg1 = /^1\d{10}$/; + let reg2=/^[a-zA-z]\w{3,14}$/; + let value=this.refs.loginPassText.value; + let valuenum= value.length; + if(valuenum>0){ + if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){ + this.setState({regular:1}) + return + }else{ + this.setState({loginValue:value}) + this.setState({regular:0}) + } + }else{ + this.setState({loginValue:value}) + } + } + + passwordChange = () =>{ + let value =this.refs.passwordText.value; + + let valuenum= value.length; + this.setState({disabled:false}) + this.setState({bottonclass:'log-botton mt5 edu-back-blue'}) + if(valuenum==0){ + this.setState({bottonclass:'log-botton mt5'}) + this.setState({disabled:true}) + } + this.setState({passValue:value}) + } + + handleInputChange =(event)=> { + const target = event.target; + const value = target.type === 'checkbox' ? target.checked : target.value; + const name = target.name; + + this.setState({[name]:value}) + + if(value===true){ + this.setState({isGoingValue:1}) + }else{ + this.setState({isGoingValue:0}) + } + + } + + // 快捷注册 + shortcutIdChange=()=>{ + let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/; + let reg1 = /^1\d{10}$/; + let reg2=/^[a-zA-z]\w{3,14}$/; + let value=this.refs.shortcutText.value; + let valuenum= value.length; + if(valuenum>0){ + if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){ + this.setState({shortcutnum:0}) + this.setState({disabledType:true}) + this.setState({gaincode : 'gain-code'}) + return + }else{ + this.setState({gaincode : 'gain-code edu-back-blue'}) + this.setState({shortcutValue:value}) + this.setState({shortcutnum:1}) + this.setState({disabledType:false}) + } + + + }else{ + this.setState({shortcutValue:value}) + + } + + } + authCodeChange=()=>{ + + let value=this.refs.authCodeText.value; + let valuenum= value.length; + if(valuenum>3){ + this.setState({authCodeType:false}) + this.setState({authCodeclass:'log-botton mt5 edu-back-blue'}) + }else if(valuenum==0){ + this.setState({authCodeType:true}) + this.setState({authCodeclass:'log-botton mt5'}) + } + } + get_login_verification_code=()=>{ + get_login_verification_code($('#get_verification_code')[0]) + } + dragWrapper=() =>{ + const $ = window.$ + $.fn.drag = function(options) { + + var x, drag = this, isMove = false, defaults = { + }; + var options = $.extend(defaults, options); + var handler = drag.find('.handler'); + var drag_bg = drag.find('.drag_bg'); + var text = drag.find('.drag_text'); + var maxWidth = 100 + //鼠标按下时候的x轴的位置 + handler.mousedown(function(e) { + isMove = true; + x = e.pageX - parseInt(handler.css('left'), 10); + maxWidth = drag.width() - handler.width() - 2; //能滑动的最大间距 + }); + $(document).mousemove(function(e) { + var _x = e.pageX - x;// _x = e.pageX - (e.pageX - parseInt(handler.css('left'), 10)) = x + if (isMove) { + + if (_x > 0 && _x <= maxWidth) { + handler.css({'left': _x}); + drag_bg.css({'width': _x}); + } else if (_x > maxWidth) { //鼠标指针移动距离达到最大时清空事件 + dragOk(); + } + } + }).mouseup(function(e) { + isMove = false; + var _x = e.pageX - x; + if (_x < maxWidth) { //鼠标松开时,如果没有达到最大距离位置,滑块就返回初始位置 + handler.css({'left': 0}); + drag_bg.css({'width': 0}); + } + }); + + //清空事件 + function dragOk() { + handler.removeClass('handler_bg').addClass('handler_ok_bg'); + text.removeClass('slidetounlock').text('验证通过').css({'color':'#fff'}); //modify + // drag.css({'color': '#fff !important'}); + + handler.css({'left': maxWidth}); // add + drag_bg.css({'width': maxWidth}); // add + + handler.unbind('mousedown'); + $(document).unbind('mousemove'); + $(document).unbind('mouseup'); + + } + } + + setTimeout(()=>{ + $('#quick-drag').drag(); + }, 4000) + } + + componentWillReceiveProps(nextProps) { + + this.setState({ + isRender:nextProps.isRender + }) + // console.log(nextProps.isRender); + + } + + componentDidMount() { + + if(this.props.isRender!=undefined){ + this.setState({ + isRender:this.props.isRender + }) + } + + // $(document).on("showLoginDialog", (e, args)=>{ + // this.setState({ + // isRender: true + // }) + // }) + + this.dragWrapper(); + + axios.interceptors.response.use((response) => { + if(response!=undefined) + if (response&&response.data.status === 401) { + this.setState({ + isRender: true + }) + } + return response; + }, (error) => { + // // if (error.response && error.response.data.error === '401 Unauthorized') { + // // this.back_url = window.location.href; + // // this.setState({ + // // isRender: true + // // }) + // // // TODO 这里如果样式变了会出现css不加载的情况 + // // const $ = window.$; + // // const isCssLoaded = window.getComputedStyle($('.log_nav li.active')[0], null) + // // .getPropertyValue('border-bottom') + // // == "2px solid rgb(69, 155, 229)" + // // if (!isCssLoaded) { + // // const isPort3007 = window.location.port == 3007; + // // let _url_origin = isPort3007 ? 'http://localhost:3000' : '' + // // + // // $('head').append( $('') + // // .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css`) ); + // // $('head').append( $('') + // // .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css`) ); + // // } + // // } + // // return Promise.reject(error); + }); + } + handleDialogClose() { + this.setState({ + isRender: false + }) + window.location.href="/"; + } + + loginEDU=()=>{ + let {loginValue,passValue,regular,isGoingValue}=this.state; + if(regular===1){ + return + } + let newloginValue=loginValue.replace(/(^\s*)|(\s*$)/g, ""); + let newpassValue=passValue.replace(/(^\s*)|(\s*$)/g, ""); + + let url='/accounts/login.json' + axios.post(url, { + login:newloginValue, + password:newpassValue, + autologin:isGoingValue + } + ).then((response) => { + if(response===undefined){ + return + } + if(response.status===200){ + if (response.data.status === 402) { + window.location.href = response.data.url; + }else{ + broadcastChannelPostMessage('refreshPage') + this.setState({ + isRender:false + }) + window.location.reload(); + } + } + + }).catch((error) => { + console.log("356"); + console.log(error) + }) + } + onKeydowns=(e)=>{ + let {disabled}=this.state; + if( disabled===false&& e.keyCode === 13){ + this.loginEDU() + console.log(1) + } + } + render() { + let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass, + dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender}=this.state; + + if (isRender === undefined) { + isRender = false + } + + return ( + this.handleDialogClose()} + > +
+
{this.handleDialogClose()}}> + +
+ +
+
    +
  • {this.enter(0)}}>登录
  • + {/*
  • {this.register(0)}}>快捷登录
  • */} +
+ + +
+
+ +
+ + +
+ + + + +

请输入有效的手机号/邮箱号/用户名

+ +
+ + +
+

+ 请输入密码 +

+
+
+ + + {/**/} + +
+ 登录 +
+ +

+ + + + + + + + 忘记密码 + 注册 + + +

+ +
+
+ + {/*快捷登录*/} + + + +
+
+ +
+ + ); + } + +} + +export default LoginDialog ; + + +// onkeypress="user_login_keypress(event);" + +// onkeypress="user_login_keypress(event);" + + +{/*
+
+
+

+
+
} + + + +{/*第三方账号登录*/} + +{/*
+

第三方账号登录

+
+ + + +
+
} + +// +// {/*
*/} +// {/*
*/} +// {/*
*/} +// {/**/} +// {/**/} +// {/*
*/} +// {/**/} +// {/**/} +// {/**/} +// {/*
*/} +// {/*

请输入有效的手机号/邮箱号*/} +// {/*

*/} +// {/*
*/} +// +// {/*
*/} +// {/*/!*drag*/ }*/} +// {/*
*/} +// {/*
*/} +// {/*
*/} +// {/*请按住滑块,拖动到最右边*/} +// {/*
*/} +// {/*
*/} +// {/*
*/} +// {/*
*/} +// {/*

请先拖动滑块完成验证

*/} +// {/*
*/} +// {/*
*/} +// +// {/*

*/} +// {/**/} +// {/**/} +// {/**/} +// {/*

*/} +// +// {/*
*/} +// {/*

*/} +// {/*请输入验证码*/} +// {/*

*/} +// {/*
*/} +// +// {/**/} +// +// {/*

*/} +// +// {/**/} +// {/**/} +// {/**/} +// {/**/} +// +// {/**/} +// {/*忘记密码*/} +// {/*注册*/} +// {/**/} +// +// {/*

*/} +// {/**/} +// {/*
*/} diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 2d1451d6b..da73b6282 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -331,18 +331,21 @@ class NewHeader extends Component { } educoderlogin=()=>{ //退出账号 - var url = `/accounts/logout.json`; - - axios.get((url)).then((result) => { - if(result!==undefined){ - // this.setState({ - // isRender:true - // }) - window.location.href = "/"; - } - }).catch((error) => { - console.log(error); + this.setState({ + isRender:true }) + // var url = `/accounts/logout.json`; + // + // axios.get((url)).then((result) => { + // if(result!==undefined){ + // // this.setState({ + // // isRender:true + // // }) + // window.location.href = "/"; + // } + // }).catch((error) => { + // console.log(error); + // }) } onKeywordSearch = () => { From 0f544ac5d98d956ba29a9db003caa56735c0703a Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 17:49:33 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/NewHeader.js | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index da73b6282..bdb6b2a09 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -331,21 +331,21 @@ class NewHeader extends Component { } educoderlogin=()=>{ //退出账号 - this.setState({ - isRender:true - }) - // var url = `/accounts/logout.json`; - // - // axios.get((url)).then((result) => { - // if(result!==undefined){ - // // this.setState({ - // // isRender:true - // // }) - // window.location.href = "/"; - // } - // }).catch((error) => { - // console.log(error); + // this.setState({ + // isRender:true // }) + var url = `/accounts/logout.json`; + + axios.get((url)).then((result) => { + if(result!==undefined){ + // this.setState({ + // isRender:true + // }) + window.location.href = "/"; + } + }).catch((error) => { + console.log(error); + }) } onKeywordSearch = () => { From 1f9c6b833b705c2369aa64314964782b25d88f8b Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Sat, 22 Jun 2019 18:13:20 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/EducoderLogin.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js index 3c3f47c87..df5b5f8b8 100644 --- a/public/react/src/modules/login/EducoderLogin.js +++ b/public/react/src/modules/login/EducoderLogin.js @@ -177,7 +177,8 @@ class EducoderLogin extends Component { "align-items": "center", "width": "100%", }}> -
© 2019 EduCoder湘ICP备17009477号Trustie & IntelliDE inside.
+
© 2019 EduCoder 湘ICP备17009477号 Trustie & IntelliDE inside
+
From 7472189ee9677e002d8d6561d9065dcf2dfb3b33 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sat, 22 Jun 2019 18:17:55 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/usersInfo/Infos.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 941217750..58c0b3c4e 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -247,9 +247,8 @@ class Infos extends Component{
{ - data && is_current == false && data.identity =="学生" ?"" : {data && data.identity} + data && is_current == false && data.identity =="学生" ? "" : {data && data.identity} } - {data && data.identity} @@ -300,8 +299,8 @@ class Infos extends Component{ data && data.can_apply_trial == false ? data.attendance_signed ? - 已签到 - 明日签到 +{next_gold} 金币 + 已签到 +

明日签到 +{next_gold} 金币

:
签到