uni.request({
url: baseUrl + opts.url,
data: data,
method: opts.method,
header: json === true || opts.methods == 'get' ? {
'X-Requested-With': 'XMLHttpRequest',
"Accept": "application/json",
"Content-Type": "application/json; charset=UTF-8"
} : {
'X-Requested-With': 'XMLHttpRequest',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
},
dataType: 'json',
success:(res)=>{
console.log('success')
resolve(res.data)
},
fail:(res)=>{
console.log('fail')
reject(res)
}
})
x***@163.com
- 发布:2021-02-03 11:35
- 更新:2021-02-03 11:42
- 阅读:2307
uni.request请求失败不调用fail调用success
分类:uni-app
突然好想你
你这个问题不描述清楚,估计官方也不知道该怎么给你解决
2021-02-03 11:46