Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hjm
daiao 6 years ago
commit 0034b26b00

@ -28,7 +28,7 @@ class CourseMessage < ApplicationRecord
def send_deal_tiding deal_status def send_deal_tiding deal_status
# 发送申请处理结果消息 # 发送申请处理结果消息
Tiding.create!( Tiding.create!(
user_id: course_message_id, trigger_user: 1, container_id: course_id, container_type: 'DealCourse', user_id: course_message_id, trigger_user_id: 1, container_id: course_id, container_type: 'DealCourse',
belong_container: course, extra: content.to_i == 2 ? '9' : '7', tiding_type: 'System', status: deal_status belong_container: course, extra: content.to_i == 2 ? '9' : '7', tiding_type: 'System', status: deal_status
) )
# 将申请消息置为已处理 # 将申请消息置为已处理

@ -4,5 +4,5 @@
# Rails.application.config.session_store :active_record_store # Rails.application.config.session_store :active_record_store
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cache_store, :expire_after => 10.hours, key: '_educoder_session', domain: :all Rails.application.config.session_store :cache_store, :expire_after => 24.hours, key: '_educoder_session', domain: :all

@ -274,6 +274,11 @@ class App extends Component {
// }, (error) => { // }, (error) => {
// //TODO 这里如果样式变了会出现css不加载的情况 // //TODO 这里如果样式变了会出现css不加载的情况
// }); // });
window.addEventListener('error', (event) => {
const msg = `${event.type}: ${event.message}`;
console.log(msg)
});
} }
//修改登录方法 //修改登录方法
Modifyloginvalue=()=>{ Modifyloginvalue=()=>{

@ -13,7 +13,7 @@ export function getImageUrl(path) {
export function setImagesUrl(path){ export function setImagesUrl(path){
const local = 'http://47.96.87.25:48080' const local = 'http://47.96.87.25:48080'
let firstStr=path.substr(0,1); let firstStr=path.substr(0,1);
console.log(firstStr); // console.log(firstStr);
if(firstStr=="/"){ if(firstStr=="/"){
return isDev?`${local}${path}`:`${path}`; return isDev?`${local}${path}`:`${path}`;
}else{ }else{

@ -68,17 +68,21 @@ class ListPageIndex extends Component{
constructor(props) { constructor(props) {
super(props); super(props);
this.state={ this.state={
yslGuideone:null, yslGuideone:undefined,
mysearch:undefined,
} }
} }
componentDidMount(){ componentDidMount(){
var yslGuideone = window.localStorage.getItem('yslGuideone'); var yslGuideone = window.sessionStorage.getItem('yslGuideone');
console.log("77"); console.log("77");
console.log(yslGuideone); console.log(yslGuideone);
var mysearchs= this.props.location.search===""?undefined:this.props.location.search===undefined?undefined:this.props.location.search==="?exhibition=true"?true:undefined;
this.setState({ this.setState({
yslGuideone:yslGuideone, yslGuideone:yslGuideone,
mysearch:mysearchs,
}) })
} }
// //
// getleftNavid=(navid,newselectnavid)=>{ // getleftNavid=(navid,newselectnavid)=>{
@ -88,34 +92,44 @@ class ListPageIndex extends Component{
// navttype:newselectnavid // navttype:newselectnavid
// }) // })
// } // }
setwindowlocal=(bool)=>{ componentWillUnmount(){
window.localStorage.setItem('yslGuideone', bool); window.sessionStorage.setItem('yslGuideone', false);
}
setwindowlocal=(bool)=>{
window.sessionStorage.setItem('yslGuideone', bool);
this.setState({ this.setState({
yslGuideone:bool, yslGuideone:bool,
}) mysearch:undefined,
});
var currenturl = this.props.location.pathname;
var newUrl = (currenturl.split("?"))[0];
window.history.pushState('','',newUrl);
} }
render() { render() {
let {yslGuideone} =this.state; let {yslGuideone,mysearch} =this.state;
// console.log("98"); // console.log("98");
// console.log(yslGuideone); // console.log(yslGuideone);
// console.log(this.props.isAdmin());
// // var yslGuideones = window.sessionStorage.getItem('yslGuideone');
// console.log(this.props);
// console.log(this.props.location.search);
return ( return (
<div> <div>
<div className="newMain clearfix"> <div className="newMain clearfix">
{/*头部banner*/} {/*头部banner*/}
<CoursesBanner {...this.props}></CoursesBanner> <CoursesBanner {...this.props}></CoursesBanner>
{/*{yslGuideone===null||yslGuideone===undefined||yslGuideone===false?*/} {mysearch!==undefined?
{/* (*/} (
{/* this.props.isAdmin()===true?*/} mysearch===true?
{/* <Guide*/} <Guide
{/* setwindowlocal={(b)=>this.setwindowlocal(b)}*/} setwindowlocal={(b)=>this.setwindowlocal(b)}
{/* >*/} >
{/* </Guide>*/} </Guide>
{/* :""*/} :""
{/* )*/} )
{/* :""*/} :""
{/*}*/} }
<div className="educontent clearfix" style={{flex: "1 0 auto"}}> <div className="educontent clearfix" style={{flex: "1 0 auto"}}>
<div className="stud-class-set"> <div className="stud-class-set">

@ -76,7 +76,7 @@ class CoursesNew extends Component {
Realnamecertification: data.authentication, Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification, Professionalcertification:data.professional_certification,
}) })
this.handleSearchschool(data.school);
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
}) })
@ -93,7 +93,9 @@ class CoursesNew extends Component {
}); });
this.setState({ this.setState({
school:user_school, school:user_school,
}) });
this.handleSearchschool(user_school);
} }
@ -203,7 +205,9 @@ class CoursesNew extends Component {
// debugger // debugger
if (response.data.status === 0) { if (response.data.status === 0) {
// this.goback() // this.goback()
window.location.href=first_category_url;
window.location.href=first_category_url+"?exhibition=true";
window.sessionStorage.setItem('yslGuideone', true);
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -247,7 +251,8 @@ class CoursesNew extends Component {
).then((response) => { ).then((response) => {
if (response.status === 200) { if (response.status === 200) {
// this.goback // this.goback
window.location.href=response.data.first_category_url; window.location.href=response.data.first_category_url+"?exhibition=true";
window.sessionStorage.setItem('yslGuideone', true);
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -403,7 +408,9 @@ class CoursesNew extends Component {
const optionschool = this.state.searchlistscholl&&this.state.searchlistscholl.map(z => <Option key={z} value={z}>{z}</Option>); const optionschool = this.state.searchlistscholl&&this.state.searchlistscholl.map(z => <Option key={z} value={z}>{z}</Option>);
// console.log(this.props.current_user.user_school) // console.log(this.props.current_user.user_school)
// form合并了 // form合并了
console.log(this.state);
console.log(this.props);
console.log(this.props.current_user);
return ( return (
<React.Fragment> <React.Fragment>

@ -21,6 +21,7 @@ class Guide extends Component {
} }
componentDidMount() { componentDidMount() {
console.log("GuideGuideGuideGuide加载了")
// 1366x768 // 1366x768
// var mywidthone=7; // var mywidthone=7;
@ -59,7 +60,7 @@ class Guide extends Component {
page:i, page:i,
}) })
if(i===7){ if(i===7){
this.props.setwindowlocal(true); this.props.setwindowlocal(false);
} }
} }
render() { render() {

Loading…
Cancel
Save