dev_hjm^2
hjm 6 years ago
parent f0e6da586a
commit b313d06271

@ -223,7 +223,7 @@ class MemoDetail extends Component {
this.createNewComment(commentContent, id, editor); this.createNewComment(commentContent, id, editor);
return; return;
} }
const url = `/api/v1/memos/${id}/reply`; const url = `/memos/${id}/reply.json`;
const { comments } = this.state; const { comments } = this.state;
const user = this._getUser(); const user = this._getUser();
/* /*
@ -473,14 +473,14 @@ class MemoDetail extends Component {
return; return;
} }
} }
const url = `/api/v1/memos/${memo.id}/reply`; const url = `/memos/${memo.id}/reply.json`;
let { comments } = this.state; let { comments } = this.state;
const user = this._getUser(); const user = this._getUser();
axios.post(url, { axios.post(url, {
content: content content: content
}, },
{ {
withCredentials: true // withCredentials: true
} }
).then((response) => { ).then((response) => {
if (response.data.status === -1) { if (response.data.status === -1) {
@ -584,9 +584,9 @@ class MemoDetail extends Component {
params.forum_id = this.state.p_forum_id; params.forum_id = this.state.p_forum_id;
} }
let paramsUrl = urlStringify(params) let paramsUrl = urlStringify(params)
const set_top_or_down_Url = `/api/v1/memos/${memo.id}/set-top-or-down?${paramsUrl}`; const set_top_or_down_Url = `/memos/${memo.id}/sticky_or_cancel.json?${paramsUrl}`;
// 获取memo list // 获取memo list
axios.get(set_top_or_down_Url, { axios.post(set_top_or_down_Url, {
// withCredentials: true, // withCredentials: true,
}) })
.then((response) => { .then((response) => {

@ -242,16 +242,18 @@ return function wrap(WrappedComponent) {
params.forum_id = this.state.p_forum_id; params.forum_id = this.state.p_forum_id;
} }
let paramsUrl = urlStringify(params) let paramsUrl = urlStringify(params)
const set_top_or_down_Url = `/api/v1/memos/${memo.id}/set-top-or-down?${paramsUrl}`; const set_top_or_down_Url = `/memos/${memo.id}/sticky_or_cancel.json?${paramsUrl}`;
// 获取memo list // 获取memo list
axios.get(set_top_or_down_Url, { axios.post(set_top_or_down_Url, {
// withCredentials: true, // withCredentials: true,
}) })
.then((response) => { .then((response) => {
const status = response.data.status const status = response.data.status
if (status === 0) { if (status === 0) {
const { memo_list } = response.data; this.fetchMemos(1, '')
this.props.initForumState({ memo_list })
// const { memo_list } = response.data;
// this.props.initForumState({ memo_list })
// 刷新列表 // 刷新列表
// TODO 服务端直接返回第一页列表 // TODO 服务端直接返回第一页列表
// this.props.history.replace('/') // this.props.history.replace('/')

Loading…
Cancel
Save