0

我有一个返回调度的动作。现在我正在发布道具......但我想在请求中添加一些像(uname,角色等)这样的东西。他最简单的方法是什么?

我想是这样的:

const addlFields = { username: 'newTester', role: 'moderator' } 

关于如何完成这项工作有什么好的建议吗?我假设这不是 axios 问题,因为 axios 并接受了道具 obj。

我的请求

const sendMessageRequest = axios.post(`${POST_MSG_URL}`, props)
  .then(response => {
    return dispatch => {
        dispatch(
          { type: POST_MESSAGE,
            payload: sendMessageRequest
          }
        );
    }
  });`
4

0 回答 0