在 Axios.get() 中添加需要传递的参数,例如:
axios.get('/user', {
params: {
ID: 12345
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
在上述示例中,将参数 ID 的值设置为 12345,并传递到了 API 的后端。如果需要传递多个参数,可以在 params 对象中添加多个键值对。