diff --git a/public/react/src/modules/forums/UserSection.js b/public/react/src/modules/forums/UserSection.js index 8ea9bad2a..4610c2441 100644 --- a/public/react/src/modules/forums/UserSection.js +++ b/public/react/src/modules/forums/UserSection.js @@ -1,62 +1,62 @@ -import React, { Component } from 'react'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames' - -import axios from 'axios' - -class UserSection extends Component { - constructor(props) { - super(props) - - this.state = { - - } - } - /*点击关注或者取消关注*/ - AboutFocus(){ - const { author_info } = this.props - /*http://localhost:3000/api/v1/users/155/watch?object_id=156&object_type=user*/ - - const focusUrl = `/api/v1/users/${author_info.user_id}/${this.props.author_info.watched ? 'unwatch' : 'watch'}?object_id=${author_info.user_id}&object_type=user` - - axios.get(focusUrl,{ - }) - .then((response) => { - const status = response.data.status; - console.log(status); - if(status == 1){ - const new_author_info = Object.assign({}, this.props.author_info) - new_author_info.watched = !new_author_info.watched - this.props.initForumState({author_info: new_author_info}) - } - }).catch((error) => { - console.log(error) - }) - } - - - render() { - const { match, history, author_info , current_user } = this.props - if (!author_info) { - return
- } - return ( -
- -

{author_info.username}

-

{author_info.identity}

- { author_info.user_id !== current_user.user_id && -

- {this.AboutFocus()}}>{ author_info.watched == true ? "取消关注" : "关注" } - 私信 -

} -
- ); - } -} - -export default UserSection; +import React, { Component } from 'react'; + +import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; + +import PropTypes from 'prop-types'; + +import classNames from 'classnames' + +import axios from 'axios' + +class UserSection extends Component { + constructor(props) { + super(props) + + this.state = { + + } + } + /*点击关注或者取消关注*/ + AboutFocus(){ + const { author_info } = this.props + /*http://localhost:3000/api/v1/users/155/watch?object_id=156&object_type=user*/ + + const focusUrl = `/api/v1/users/${author_info.user_id}/${this.props.author_info.watched ? 'unwatch' : 'watch'}?object_id=${author_info.user_id}&object_type=user` + + axios.get(focusUrl,{ + }) + .then((response) => { + const status = response.data.status; + console.log(status); + if(status == 1){ + const new_author_info = Object.assign({}, this.props.author_info) + new_author_info.watched = !new_author_info.watched + this.props.initForumState({author_info: new_author_info}) + } + }).catch((error) => { + console.log(error) + }) + } + + + render() { + const { match, history, author_info , current_user } = this.props + if (!author_info) { + return
+ } + return ( +
+ +

{author_info.username}

+

{author_info.identity}

+ { author_info.user_id !== current_user.user_id && +

+ {this.AboutFocus()}}>{ author_info.watched == true ? "取消关注" : "关注" } + 私信 +

} +
+ ); + } +} + +export default UserSection; diff --git a/public/react/src/modules/modals/DownloadMessage.js b/public/react/src/modules/modals/DownloadMessage.js index b7796316c..0e975be09 100644 --- a/public/react/src/modules/modals/DownloadMessage.js +++ b/public/react/src/modules/modals/DownloadMessage.js @@ -18,7 +18,7 @@ class DownloadMessage extends Component { setDownload=()=>{ this.modalCancel(); - window.open(`/users/${this.props.user.login}/message_detail?user_id=1`) + window.open(`/message/${this.props.user.login}/message_detail?target_ids=1`) } modalCancel = () => { this.setState({ diff --git a/public/react/src/modules/modals/DownloadMessageysl.js b/public/react/src/modules/modals/DownloadMessageysl.js index b5c23960a..db715297f 100644 --- a/public/react/src/modules/modals/DownloadMessageysl.js +++ b/public/react/src/modules/modals/DownloadMessageysl.js @@ -11,7 +11,7 @@ class DownloadMessageysl extends Component { setDownload=()=>{ this.props.modalCancel(); - window.open(`/users/${this.props.user.login}/message_detail?user_id=1`) + window.open(`/message/${this.props.user.login}/message_detail?target_ids=1`) } render() { diff --git a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js index 5179964a5..13bec2dd9 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js +++ b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js @@ -293,8 +293,8 @@ class PackageIndexNEITaskDetails extends Component { onMouseOver={this.setover} onMouseOut={this.setout} > - {overtype===false? 头像联系TA: - 头像 头像联系TA: + 头像联系TA} } @@ -407,7 +407,7 @@ class PackageIndexNEITaskDetails extends Component { {item.status==="bidding_won"?:""}

{item.name}

- {this.props.current_user&&this.props.current_user.login!=item.login? + {this.props.current_user&&this.props.current_user.login!=item.login? 头像联系TA :""} diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 31fef9070..df376e4e5 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -357,7 +357,7 @@ class Infos extends Component{ :
{followed ? "取消关注":"关注"} - 私信 + 私信
}