【发布时间】:2018-10-06 14:37:49
【问题描述】:
axios.put('http://localhost:3000/api/userDatas/findUserAddProp',{
params: {
userId: "5bb8c3bd16bf1f515ce5b42f",
prop: "questions",
questionId: "5bb8c466cb49d8421c05eeda"
}
});
服务器
Userdatas.findUserAddProp = function(req, res, cb) {
const queryId = req.query.userId;
const propToUpdate = req.query.prop;
const questionId = req.query.questionId;
console.log("queryId: ", queryId);
console.log("propToUpdate: ", propToUpdate);
console.log("questionId: ", questionId);
...
}
这是控制台上的服务器输出。
queryId: undefined
propToUpdate: undefined
questionId: undefined
为什么会发生这种情况,我只是将所有参数传递给服务器?
【问题讨论】:
-
请查看
console.log(req.body) -
问题解决了吗?
标签: axios loopbackjs put