confirmLogon() {
for (var i = 0; i < this.logonTableData.length; i++) {
if (this.logonTableData[i].gid.length > 0) {
this.logonTableData[i].gid = this.logonTableData[i].gid[
this.logonTableData[i].gid.length - 1
]
}
}
console.log(this.logonTableData)
let formData = new FormData()
formData.append(‘users’, JSON.stringify(this.logonTableData))
this.$axios({
method: ‘post’,
url: ‘/user/batchCreate’,
data: formData,
headers: {
‘content-type’: ‘application/form-data’,
},
})
.then((res) => {
console.log(res)
if (res.data.resp_code == 0) {
console.log(res.data.datas)
this.getAllUser()
// this.rolesOptions = JSON.parse(
// JSON.stringify(res.data.datas.content)
// )
// this.total = res.data.datas.totalSize
}
})
.catch((error) => {
console.log(error)
})
},
form-data 传参
最新推荐文章于 2024-04-28 19:01:01 发布