diff --git a/public/react/src/modules/message/js/MessagChat.js b/public/react/src/modules/message/js/MessagChat.js index c412a88ff..2d43f400c 100644 --- a/public/react/src/modules/message/js/MessagChat.js +++ b/public/react/src/modules/message/js/MessagChat.js @@ -29,11 +29,13 @@ class MessagChat extends Component{ } componentDidMount(){ this.getdata(1); - let target_ids=this.props.match.params.private; - this.getChatList(1,this.state.limits,target_ids); - // console.log("MessagChat111111"); - // console.log(this.props.myysluser); - this.setState({ + + const query = this.props.location.search; + let target_ids = query.split('?target_ids='); + this.getChatList(1,this.state.limits,target_ids[1]); + // console.log("MessagChat111111"); + // console.log(this.props.myysluser); + this.setState({ myyslusers:this.props.myysluser }) try { @@ -293,7 +295,7 @@ class MessagChat extends Component{ // mess:true, // }) - this.props.history.replace(`/message/${this.props.current_user.user_id}/${user.id}/message_detail`); + this.props.history.replace(`/message/${this.props.current_user.user_id}/message_detail?target_ids=${user.id}`); // this.getdatatwo(this.state.page); this.getChatListtwo(this.state.pages,this.state.mypagey,user.id); @@ -301,10 +303,11 @@ class MessagChat extends Component{ //回复 setreplyfun=()=>{ let contents=this.messageRef.current.getValue().trim(); - let target_ids=this.props.match.params.private + const query = this.props.location.search; + let target_ids = query.split('?target_ids='); let url = `/users/${this.props.match.params.userid}/private_messages.json`; axios.post(url, { - target_id: target_ids, + target_id: target_ids[1], content: contents }) .then((response) => { diff --git a/public/react/src/modules/message/js/Messagerouting.js b/public/react/src/modules/message/js/Messagerouting.js index 619e1b838..db61376b2 100644 --- a/public/react/src/modules/message/js/Messagerouting.js +++ b/public/react/src/modules/message/js/Messagerouting.js @@ -122,7 +122,7 @@ class Messagerouting extends Component{ myysluser:item, }); console.log("22222222222"); - this.props.history.replace(`/message/${this.props.current_user.user_id}/${item.id}/message_detail`); + this.props.history.replace(`/message/${this.props.current_user.user_id}/message_detail?target_ids=${item.id}`); } }; @@ -209,7 +209,7 @@ class Messagerouting extends Component{ } > {/*/!*私信聊天页面*! letters/*/} - (this.Message2()} Modifyur={(i)=>this.Modifyur(i)} Mtab={(i)=>this.myxiaoxisixintab(i)}>) }