forked from Gitlink/forgeplus-react
Change Forum Url
This commit is contained in:
parent
b5881d5162
commit
6950c1a820
38
src/App.js
38
src/App.js
|
@ -79,15 +79,15 @@ const http500 = Loadable({
|
|||
loader: () => import('./modules/500/http500'),
|
||||
loading: Loading,
|
||||
})
|
||||
const InfosIndex = Loadable({
|
||||
loader: () => import('./forge/users/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
// const InfosIndex = Loadable({
|
||||
// loader: () => import('./forge/users/Index'),
|
||||
// loading: Loading,
|
||||
// })
|
||||
// 组织
|
||||
const OrganizeIndex = Loadable({
|
||||
loader: () => import('./forge/Team/Index'),
|
||||
loading: Loading,
|
||||
})
|
||||
// const OrganizeIndex = Loadable({
|
||||
// loader: () => import('./forge/Team/Index'),
|
||||
// loading: Loading,
|
||||
// })
|
||||
|
||||
class App extends Component {
|
||||
constructor(props) {
|
||||
|
@ -235,14 +235,14 @@ class App extends Component {
|
|||
<Router>
|
||||
<Switch>
|
||||
{/*项目*/}
|
||||
<Route
|
||||
{/* <Route
|
||||
path={"/projects/:projectId/ops/:opsId/detail"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OpsDetail {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
</Route> */}
|
||||
<Route
|
||||
path="/accounts/:login"
|
||||
render={(props) => (
|
||||
|
@ -264,41 +264,35 @@ class App extends Component {
|
|||
)}
|
||||
></Route>
|
||||
{/*项目*/}
|
||||
<Route
|
||||
{/* <Route
|
||||
path={"/projects"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<Projects {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
</Route> */}
|
||||
{/*403*/}
|
||||
<Route path="/403" component={Shixunauthority} />
|
||||
<Route path="/500" component={http500} />
|
||||
<Route path={"/organize"}
|
||||
{/* <Route path={"/organize"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OrganizeIndex {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
</Route> */}
|
||||
{/*404*/}
|
||||
<Route path="/nopage" component={Shixunnopage} />
|
||||
{/* 个人主页 */}
|
||||
<Route path="/users/:username"
|
||||
render={
|
||||
(props) => {
|
||||
return (<InfosIndex {...this.props} {...this.state} />)
|
||||
}
|
||||
}></Route>
|
||||
<Route exact path="/"
|
||||
render={
|
||||
(props) => (
|
||||
<Projects {...this.props} {...props} {...this.state}></Projects>
|
||||
<Forums {...this.props} {...this.state} {...props} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
<Route component={Shixunnopage} />
|
||||
{/* <Route component={Shixunnopage} /> */}
|
||||
</Switch>
|
||||
</Router>
|
||||
</MuiThemeProvider>
|
||||
|
|
|
@ -58,8 +58,8 @@ export function initAxiosInterceptors(props) {
|
|||
initOnlineOfflineListener()
|
||||
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
|
||||
var
|
||||
// proxy = "http://localhost:3000"
|
||||
proxy = "https://testforgeplus.trustie.net"
|
||||
proxy = "http://localhost:3000"
|
||||
// proxy = "https://testforgeplus.trustie.net"
|
||||
|
||||
const requestMap = {};
|
||||
window.setfalseInRequestMap = function (keyName) {
|
||||
|
|
|
@ -19,7 +19,7 @@ export default (({user})=>{
|
|||
<WhiteBack className="authorCard">
|
||||
<UserInfo url={getUrl(user && user.image_url)} name={user && user.username} login={user && user.login} column/>
|
||||
<p style={{width:"100%"}} className="task-hide grey-8 mt10 mb15 edu-text-center">{user && user.description ? user.description : "这家伙太懒了,还未填写个人描述!"}</p>
|
||||
{user && !user.is_current_user && (
|
||||
{/* {user && !user.is_current_user && (
|
||||
<StarUser
|
||||
current_login={user.current_login}
|
||||
login={user.login}
|
||||
|
@ -31,7 +31,7 @@ export default (({user})=>{
|
|||
set_fans_count={fans_count}
|
||||
show_block={false}
|
||||
></StarUser>
|
||||
)}
|
||||
)} */}
|
||||
<Grid className="mt20">
|
||||
<UDStructure>
|
||||
<span>{user && user.memos_count}</span>
|
||||
|
|
|
@ -17,7 +17,7 @@ export default (({ memos , selectKey })=>{
|
|||
{
|
||||
list && list.length>0 ? list.map((item,key)=>{
|
||||
return(
|
||||
<li className="task-hide"><Link to={`/forums/${item.id}/detail`}>{item.subject}</Link></li>
|
||||
<li className="task-hide"><Link to={`/forums/${item && item.id}/detail`}>{item && item.subject}</Link></li>
|
||||
)
|
||||
}):
|
||||
<Nodata _html={`暂无${keys === "hot" ? "话题":"推荐"}~`} />
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import axios from "axios";
|
||||
import { message } from "antd";
|
||||
export default ({ isPrised, num, memo_id, container_type, current_login }) => {
|
||||
export default ({ isPrised, num, memo_id, container_type, current_login, props }) => {
|
||||
const [flag, setFlag] = useState(undefined);
|
||||
const [number, setNumber] = useState(undefined);
|
||||
|
||||
|
@ -27,7 +27,9 @@ export default ({ isPrised, num, memo_id, container_type, current_login }) => {
|
|||
message.error(error);
|
||||
});
|
||||
} else {
|
||||
window.open("/login", "_blank");
|
||||
props.showLoginDialog();
|
||||
return;
|
||||
// window.open("/login", "_blank");
|
||||
}
|
||||
}
|
||||
return (
|
||||
|
|
|
@ -193,6 +193,7 @@ function memo_show(props) {
|
|||
memo_id={memo.id}
|
||||
container_type="Memo"
|
||||
current_login={memoUser && memoUser.current_login}
|
||||
props={props}
|
||||
/>
|
||||
</div>
|
||||
</WhiteBack>
|
||||
|
@ -202,6 +203,7 @@ function memo_show(props) {
|
|||
target_type="memos"
|
||||
current_user_image={memoUser && memoUser.current_image_url}
|
||||
current_login={memoUser && memoUser.current_login}
|
||||
props={props}
|
||||
/>
|
||||
</WhiteBack>
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { Component } from "react";
|
|||
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
|
||||
import { SnackbarHOC } from "educoder";
|
||||
import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import { Route, Switch, Redirect } from "react-router-dom";
|
||||
import Loading from "../Loading";
|
||||
import Loadable from "react-loadable";
|
||||
import "./css/Index.css";
|
||||
|
@ -50,6 +50,14 @@ class Index extends Component {
|
|||
render={(props) => <New {...this.props} {...props} />}
|
||||
></Route>
|
||||
<Route path="/forums" render={(props) => <Forums {...this.props} {...props}/>}></Route>
|
||||
<Redirect from="/" to="/forums"/>
|
||||
{/* <Route
|
||||
exact
|
||||
path="/"
|
||||
render={(props) => (
|
||||
<Forums {...this.props} {...props}/>
|
||||
)}
|
||||
></Route> */}
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -147,7 +147,7 @@ function New(props, ref) {
|
|||
// 上传的图片
|
||||
function UploadFunc(e) {
|
||||
attachments && attachments.length>0 && attachments.map((item,key)=>{
|
||||
return e.push(item.id)
|
||||
return e.push(item && item.id)
|
||||
});
|
||||
setAttachments(e);
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ function New(props, ref) {
|
|||
setSpining(true);
|
||||
let params = {
|
||||
forum_id: values.forum_id,
|
||||
attachment_id: ImgInfo && ImgInfo.attachment_id,
|
||||
attachment_id: ImgInfo && ImgInfo.id,
|
||||
children_forum_id: values.children_forum_id,
|
||||
attachments,
|
||||
memo: {
|
||||
|
@ -201,6 +201,8 @@ function New(props, ref) {
|
|||
}else{
|
||||
// 新建提交
|
||||
const url = `/memos.json`;
|
||||
console.log("params", params)
|
||||
|
||||
axios.post(url, params).then((result) => {
|
||||
if (result && result.data) {
|
||||
notification.open({
|
||||
|
|
|
@ -13,6 +13,7 @@ function comment_list({
|
|||
is_children,
|
||||
target_type,
|
||||
commet_destroy,
|
||||
props
|
||||
}) {
|
||||
const [is_reply, setIsReply] = useState(false);
|
||||
const [is_delete, setIsDelete] = useState(false);
|
||||
|
@ -38,7 +39,8 @@ function comment_list({
|
|||
if (current_login) {
|
||||
setIsReply(reply_boolean);
|
||||
} else {
|
||||
window.open("/login", "_blank");
|
||||
props.showLoginDialog();
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -59,7 +61,9 @@ function comment_list({
|
|||
message.error(error);
|
||||
});
|
||||
} else {
|
||||
window.open("/login", "_blank");
|
||||
props.showLoginDialog();
|
||||
return;
|
||||
// window.open("/login", "_blank");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ function comments({
|
|||
target_type,
|
||||
current_user_image,
|
||||
current_login,
|
||||
props
|
||||
}) {
|
||||
const [currentImage, setCurrentImage] = useState(null);
|
||||
const [replies, setReplies] = useState([]);
|
||||
|
@ -63,8 +64,10 @@ function comments({
|
|||
if(current_login){
|
||||
setIsClick(reply_boolean);
|
||||
}else{
|
||||
window.open("/login", "_blank")
|
||||
props.showLoginDialog();
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const create_new_reply = (reply) => {
|
||||
|
@ -121,6 +124,7 @@ function comments({
|
|||
is_children={false}
|
||||
target_type={target_type}
|
||||
commet_destroy={success_delete_reply}
|
||||
props={props}
|
||||
></CommentList>
|
||||
</List.Item>
|
||||
)}
|
||||
|
|
|
@ -768,8 +768,9 @@ class NewHeader extends Component {
|
|||
{
|
||||
coursestypes === true && this.props.user && this.props.user.main_site === false ? "" :
|
||||
<ul className="edu-txt-center">
|
||||
<li><Link to={"/projects/mirror/new"}>新建镜像项目</Link></li>
|
||||
<li><Link to={"/projects/deposit/new"}>新建托管项目</Link></li>
|
||||
<li><Link to={"/forums/new"}>发布帖子</Link></li>
|
||||
{/* <li><Link to={"/projects/mirror/new"}>新建镜像项目</Link></li>
|
||||
<li><Link to={"/projects/deposit/new"}>新建托管项目</Link></li> */}
|
||||
</ul>
|
||||
}
|
||||
</div>
|
||||
|
@ -839,7 +840,7 @@ class NewHeader extends Component {
|
|||
<ul className="edu-menu-list" style={{ top: '60px', textAlign: 'center' }}>
|
||||
<li className="bor-bottom-greyE" style={{cursor:"default",background:"#fff"}}>{this.props.current_user.username}</li>
|
||||
<li>
|
||||
<Link to={`/users/${this.props.current_user.login}`}>个人中心</Link>
|
||||
<Link to={`/accounts/${this.props.current_user.login}/memos`}>个人中心</Link>
|
||||
</li>
|
||||
{
|
||||
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_courses &&
|
||||
|
@ -847,7 +848,7 @@ class NewHeader extends Component {
|
|||
}
|
||||
{
|
||||
mygetHelmetapi2 && mygetHelmetapi2.new_course && mygetHelmetapi2.new_course.my_organ &&
|
||||
<li><a href={`/users/${this.props.current_user.login}/organize`} target="_blank">我的组织</a></li>
|
||||
<li><a href={`${mygetHelmetapi2.new_course.my_organ}`} target="_blank">我的组织</a></li>
|
||||
}
|
||||
<li className="bor-top-greyE">
|
||||
<a onClick={() => this.educoderloginysl()}>退出</a>
|
||||
|
|
Loading…
Reference in New Issue