diff --git a/app/controllers/trustie_hacks_controller.rb b/app/controllers/trustie_hacks_controller.rb index 0ae56383c..462a5a057 100644 --- a/app/controllers/trustie_hacks_controller.rb +++ b/app/controllers/trustie_hacks_controller.rb @@ -15,7 +15,7 @@ class TrustieHacksController < ApplicationController hacks = hacks.where("name like ?", "%#{search}%") end - @hackathon_users_count = hacks ? 0 : hacks.sum(:hack_users_count) + @hackathon_users_count = hacks.blank? ? 0 : hacks.sum(:hack_users_count) @hacks_count = hacks.count @hacks = hacks.page(page).per(limit) diff --git a/public/react/src/modules/courses/exercise/yslexercisetable.css b/public/react/src/modules/courses/exercise/yslexercisetable.css index 2727ca2ff..98d7e6855 100644 --- a/public/react/src/modules/courses/exercise/yslexercisetable.css +++ b/public/react/src/modules/courses/exercise/yslexercisetable.css @@ -46,4 +46,4 @@ text-overflow:ellipsis; white-space:nowrap; cursor: default; -} \ No newline at end of file +} diff --git a/public/react/src/modules/courses/poll/PollDetailTabForthRules.js b/public/react/src/modules/courses/poll/PollDetailTabForthRules.js index 472d7e351..f85198c1d 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabForthRules.js +++ b/public/react/src/modules/courses/poll/PollDetailTabForthRules.js @@ -62,7 +62,7 @@ class PollDetailTabForthRules extends Component{ this.unitChoose(this.props.rules); } if(this.props.flagPageEdit != prevProps.flagPageEdit){ - this.setState({flagPageEdit:this.props.flagPageEdit}) + this.setState({flagPageEdit: this.props.flagPageEdit}) } } componentDidMount=()=>{ @@ -107,7 +107,7 @@ class PollDetailTabForthRules extends Component{ //修改发布规则里面的结束时间 changeRuleEndTime=(e,date,index)=>{ let arr=Object.assign({}, this.state.rules[parseInt(index)]); - + arr.end_time=handleDateString(date); if(date!="" && date!=undefined && moment(date,dataformat)>moment() && moment(date,dataformat)>moment(arr.publish_time,dataformat)){ arr.end_flag="" @@ -139,7 +139,7 @@ class PollDetailTabForthRules extends Component{ }) this.props.rulesCheckInfo && this.props.rulesCheckInfo(rules) } - + // changeOpen=(e,index)=>{ // let arr=Object.assign({}, this.state.rules[parseInt(index)]); // arr.open= true; @@ -168,9 +168,9 @@ class PollDetailTabForthRules extends Component{ rules[index]=arr; //修改选择分班下拉选项(是否被选中) //let course_group = this.state.course_group; - + this.unitChoose(rules); - + this.setState({ rules:rules, @@ -194,8 +194,8 @@ class PollDetailTabForthRules extends Component{ } }); } - - let course_group =this.state.course_group; + + let course_group =this.state.course_group; course_group.forEach(ele=>{ if(arr.indexOf(ele.course_group_id) != -1){ ele.course_choosed = 1 @@ -356,10 +356,10 @@ class PollDetailTabForthRules extends Component{ max-width:280px; } `} - - { + + { rules && rules.length > 0 && rules.map((rule,r)=>{ - const courseGroup = rule.course_search !="" ? + const courseGroup = rule.course_search != "" ? course_group.filter( item => item.course_group_name.indexOf(rule.course_search) != -1) :course_group @@ -451,19 +451,19 @@ class PollDetailTabForthRules extends Component{ this.changeRuleEndTime(e, date,r)} - showTime={{ format: 'HH:mm' }} - format="YYYY-MM-DD HH:mm" - disabledTime={disabledDateTime} + showToday={false} + dropdownClassName="hideDisable" + placeholder="请选择截止时间" + locale={locale} + className={rule.end_flag && rule.end_flag !="" ? "noticeTip winput-240-40":"winput-240-40" } + value={rule.end_time && moment(rule.end_time,dataformat)} + onChange={(e, date)=>this.changeRuleEndTime(e, date,r)} + showTime={{ format: 'HH:mm' }} + format="YYYY-MM-DD HH:mm" + disabledTime={disabledDateTime} disabledDate={disabledDate} - disabled={ rule.e_timeflag ===undefined?rule.publish_time===null?false:!flagPageEdit:rule.e_timeflag == true ? true : !flagPageEdit} - style={{"height":"42px"}} + disabled={rule.e_timeflag === undefined ? rule.publish_time === null ? false : moment(rule.end_time, dataformat) <= moment() ? true : !flagPageEdit : rule.e_timeflag == true ? true : !flagPageEdit} + style={{"height":"42px"}} > @@ -480,7 +480,7 @@ class PollDetailTabForthRules extends Component{ this.removeRules(`${r}`)}> :"": - r > 0 && rule.p_timeflag == false ? + r > 0 && rule.p_timeflag == false ? this.removeRules(`${r}`)}> @@ -490,13 +490,13 @@ class PollDetailTabForthRules extends Component{ :"" } - - + + ) - }) + }) } ) } } -export default PollDetailTabForthRules; \ No newline at end of file +export default PollDetailTabForthRules; diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index e43be32ea..2f3f787b5 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -26,6 +26,7 @@ import '../css/members.css'; import '../css/busyWork.css'; import '../poll/pollStyle.css'; import './Challenges.css'; + import {getImageUrl} from 'educoder'; import TraineetraininginformationModal from "./TraineetraininginformationModal"; import DownloadMessageysl from '../../modals/DownloadMessageysl'; @@ -952,9 +953,9 @@ class Listofworksstudentone extends Component { key: 'classroom', dataIndex: 'classroom', align: 'center', - className: 'font-14', + className: 'font-14 maxnamewidth120', render: (text, record) => ( - + {record.classroom === undefined ? -- : record.classroom === null ? -- : - {record.classroom}} + {record.classroom}} ) }, @@ -1218,7 +1220,7 @@ class Listofworksstudentone extends Component { onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)} onClick={() => this.Viewstudenttraininginformationt(record)}>评阅 : - this.Viewstudenttraininginformationtysl2(e, record)} onClick={() => this.Viewstudenttraininginformationt(record)}>评阅 @@ -1299,9 +1301,9 @@ class Listofworksstudentone extends Component { key: 'classroom', dataIndex: 'classroom', align: 'center', - className: 'font-14', + className: 'font-14 maxnamewidth120', render: (text, record) => ( - + {record.classroom === undefined ? -- : record.classroom === null ? - -- : - {record.classroom}} + -- : + {record.classroom}} ) }, diff --git a/public/react/src/modules/courses/shixunHomework/style.css b/public/react/src/modules/courses/shixunHomework/style.css index dce4251a4..657ebded0 100644 --- a/public/react/src/modules/courses/shixunHomework/style.css +++ b/public/react/src/modules/courses/shixunHomework/style.css @@ -51,6 +51,14 @@ white-space:nowrap; cursor: default; } + +.maxnamewidth120 { + max-width: 120px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + cursor: default; +} .maxnamewidth200{ max-width: 200px; overflow:hidden; diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index cf78d97e0..e580e7cce 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -745,7 +745,7 @@ class LoginDialog extends Component { frameBorder="0" sandbox="allow-scripts allow-same-origin allow-top-navigation" scrolling="no" - src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginstart&response_type=code&scope=snsapi_login#wechat_redirect`}>:""} + src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login&state=null,${window.location.host}#wechat_redirect`}>:""} {weixinlogin===true?

diff --git a/public/react/src/modules/login/Otherloginstart.js b/public/react/src/modules/login/Otherloginstart.js index 9901fc8ad..b549fdeae 100644 --- a/public/react/src/modules/login/Otherloginstart.js +++ b/public/react/src/modules/login/Otherloginstart.js @@ -8,10 +8,12 @@ class Otherloginstart extends Component { componentDidMount() { let query=this.props.location.search; - debugger + if(query!= ""){ const type = query.split('?code='); const types = type[1].split('&state='); + const typeshref = types[1].split(','); + let codeurl = `/auth/wechat/callback.json` axios.get(codeurl,{params:{ code:types[0] @@ -19,13 +21,13 @@ class Otherloginstart extends Component { if(result){ if(result.data.status===0){ if(result.data.new_user===true){ - window.location.href="/otherlogin?type=wechat" + window.location.href=`https://${typeshref[1]}/otherlogin?type=wechat`; }else{ // this.getinfo() - if(types[1]==="account"){ - window.location.href="/account/binding" + if(typeshref[1]==="account"){ + window.location.href=`https://${typeshref[1]}/account/binding`; }else{ - window.location.href="/" + window.location.href=`https://${typeshref[1]}`; } } diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 41954a3fb..3090dc0dc 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -1293,7 +1293,7 @@ class LoginRegisterComponent extends Component { frameBorder="0" sandbox="allow-scripts allow-same-origin allow-top-navigation" scrolling="no" - src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginstart&response_type=code&scope=snsapi_login#wechat_redirect`}>:""} + src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login&state=null,${window.location.host}#wechat_redirect`}>:""} {weixinlogin===true?

this.hideweixinlogin()}>返回登录注册

:""} diff --git a/public/react/src/modules/user/account/AccountBinding.js b/public/react/src/modules/user/account/AccountBinding.js index c1974a746..24032e84e 100644 --- a/public/react/src/modules/user/account/AccountBinding.js +++ b/public/react/src/modules/user/account/AccountBinding.js @@ -242,7 +242,7 @@ class AccountSecure extends Component {
{list.map((item,key)=>{ - + if(item.en_type!="qq"){ return(
@@ -258,9 +258,9 @@ class AccountSecure extends Component {
{item.en_type!="qq"? this.showModal("wechat"):() => this.undologin("wechat",item.id) - } + onClick={ + item.id===null?() => this.showModal("wechat"):() => this.undologin("wechat",item.id) + } >{item.id===null?"绑定":"解绑"}: this.openqqlogin():() => this.openphoneqqlogin():() => this.undologin("qq",item.id) @@ -271,6 +271,7 @@ class AccountSecure extends Component {
) + } }) } @@ -297,7 +298,7 @@ class AccountSecure extends Component { frameBorder="0" sandbox="allow-scripts allow-same-origin allow-top-navigation" scrolling="no" - src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginstart&response_type=code&scope=snsapi_login&state=account#wechat_redirect`}> + src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login&state=account,${window.location.host}#wechat_redirect`}>

this.handleCancel()}>取消