之前我都是当客户不传值是传空字符串给后端,但是今天后盾跟我说用的是精确查询不必要的空字符串不要传过去,下面就进行探索
const params = {}
if (this.formInline.password) {
params.password= this.formInline.password
}
if (this.formInline.name) {
params.name = this.formInline.name
}
this.$axios.post('/接口', params).then(res => {
this.tableData= res.data.data.ret
})
OK~