forked from Gitlink/forgeplus-react
Change ForumSection Watch APi
This commit is contained in:
parent
d1232be557
commit
4596eac895
|
@ -58,8 +58,8 @@ export function initAxiosInterceptors(props) {
|
||||||
initOnlineOfflineListener()
|
initOnlineOfflineListener()
|
||||||
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
|
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
|
||||||
var
|
var
|
||||||
// proxy = "http://localhost:3000"
|
proxy = "http://localhost:3000"
|
||||||
proxy = "https://testforgeplus.trustie.net"
|
// proxy = "https://testforgeplus.trustie.net"
|
||||||
|
|
||||||
const requestMap = {};
|
const requestMap = {};
|
||||||
window.setfalseInRequestMap = function (keyName) {
|
window.setfalseInRequestMap = function (keyName) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ export default ({ headData, title , operation , history }) => {
|
||||||
// 收藏、取消收藏
|
// 收藏、取消收藏
|
||||||
function saveForum(id){
|
function saveForum(id){
|
||||||
if(id){
|
if(id){
|
||||||
const url = `/memos/forum_memos/${id}/is_watch.json`;
|
const url = `/forum_memos/${id}/is_watch.json`;
|
||||||
axios.post(url,{
|
axios.post(url,{
|
||||||
is_watch:watched?0:1
|
is_watch:watched?0:1
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
|
|
|
@ -16,7 +16,7 @@ function section_item({ forum_section, key }) {
|
||||||
|
|
||||||
function handleClick(){
|
function handleClick(){
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
let url = `/v1/memos/forum_memos/${forum_section.id}/is_watch.json`;
|
let url = `/forum_memos/${forum_section.id}/is_watch.json`;
|
||||||
axios.post(url, {
|
axios.post(url, {
|
||||||
is_watch: isStar ? 0 : 1
|
is_watch: isStar ? 0 : 1
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue