0
我在使用axios發佈數據時遇到問題,第一次將數據正確保存到數據庫中。但是第二次,url正在使用最後一個id。額外的參數正在axios中的URL中添加
例如:第一次URL會像:www.ex.com/images 第二次:www.ex.com/images?details_id=1
export let url = axios.create({
baseURL: constants.URL,
headers: {
'Content-Type': 'application/json',
},
responseType: 'json',
});
const data = new FormData();
data.append("image", props.image);
data.append("details_id", props.details_id);
config.auth.post('images', data)
.then(function (response) {
//my code
}))
謝謝。