如图所示,用的post请求,

接口是这样定义的:

const insertData = (params) => {
  return axios({
    url: '/organization/Menu/insertData',
    method: 'post',
    params: params
  })
}

export default { getTree, getupdateData, updateData, insertData }

axios用post发送请求,结果接口地址上会带有参数-LMLPHP后来发现时传的参数不对,不应该用params传,应该用data,就可以了(params是url的query)

const insertData = (params) => {
  return axios({
    url: '/organization/Menu/insertData',
    method: 'post',
    data: params
  })
}

export default { getTree, getupdateData, updateData, insertData }

以后再研究axios,再继续补充!!!!

07-10 12:21