我發佈的數據節點服務器:無法轉換對象原始值
{
"form_1": [{
"resultName": "",
"level": "",
"unitOrder": "",
"winner": "",
"winnerOrder": "",
"date": "1",
"score": ""
}],
"form_2": [{
"resultName": "",
"level": "",
"unitOrder": "",
"winner": "",
"winnerOrder": "",
"date": "1",
"score": ""
}],
"form_3": [{
"resultName": "",
"level": "",
"unitOrder": "",
"winner": "",
"winnerOrder": "",
"date": "1",
"score": ""
}]
}
我嘗試CONSOLE.LOG快遞服務器上的數據:
console.log(req.body)
,但總會有錯誤:
TypeError: Cannot convert object to primitive value
我不明白。那麼我如何獲取數據呢?
請參閱http://stackoverflow.com/questions/24339780/posting-object-array-to-sails-causes-typeerror-cannot-convert-object-to-primit – Troajan
我只是嘗試console.log一個對象,它運作良好。 @Troajan – laoqiren