// 传递的参数
FormData:{
search_key:'111',
user_name:'',
time:[] ,
status:'',
}
// 请求的方法
handleGetTask() {
let _this = this
for( let key in _this.FormData){
if(!_this.FormData[key] || _this.FormData[key].length == 0){
delete _this.FormData[key]
}
}
_this.uni_request_api({
url: '请求路径',
method: 'POST',
data: {
..._this.FormData,
},
success(res) {},
})
},
前端向后台传参时删除为空的参数
最新推荐文章于 2024-01-05 11:26:15 发布