methods层
onkeyCareate(params) {
let formData = new FormData();
formData.append('id', params.row.id);
formData.append('type', 1);
onkeycreate(formData).then(
(res) => {
alert("结果 " + res.data);
console.log("结果 " + res.data);
this.$router.push({
name: "historydata_download"
});
}
)
},
api层
export const onkeycreate = (data) => { console.info(data); return axios.request({ url: 'customtasks/onkeycreate', method: 'post', config: "formData", data }) }