change(point,value) {
console.log(point, value)
axios.post('http://localhost/' + point, {
point: value
})
.then(function (response) {
currentObj.output = response.data
})
.catch(function (error) {
currentObj.output = error
});
}
点内的值= K1值= 7
发送回复时
{
point : 7
}
但是我希望响应是这样的。
{
K1 : 7
}
操作方法
答案 0 :(得分:1)
您的代码有一些语法错误。
sqoop import --connect jdbc:mysql://quickstart.cloudera:3306/retail_db --username root --password cloudera --query "select * from customers where \$CONDITIONS AND customer_street like '%Plaza%'" --target-dir /user/cloudera/problem1/customers/textdata --fields-terminated-by '*' --lines-terminated-by '|' --as-textfile --columns "customer_id,customer_fname,customer_lname,customer_street" --split-by "customer_id"
应该是http:localhost
http://localhost
我建议您在API中以所需的方式格式化响应
答案 1 :(得分:0)
代替point:value应该是 [point]:value
change(point,value) {
console.log(point, value)
axios.post('http://localhost/' + point, {
[point]: value
})
.then(function (response) {
currentObj.output = response.data
})
.catch(function (error) {
currentObj.output = error
});
}