请求无反应
const request = (_ad, _method = 'GET', data = {}, failCallback) => {
//异步请求数据
return new Promise(resolve => {
let header={
'Content-Type': 'application/json;charset=UTF-8',
}
let token = uni.getStorageSync('token')
token ? header['Authori-zation']='Bearer ' + token : null
let baseUrl = config.def().baseUrl
console.log('data === ',data);
console.log('baseUrl === ',baseUrl);
uni.request({
url: baseUrl + '/api/'+_ad,
data: data,
method: _method,
header:header,
success: (res) => {
console.log('res====',res)
uni.request 请求无反应 也没有报错 控制台也无打印
支付宝开发工具是1.13.7版本
3 个回复
anisy (作者)
是不兼容吗
anisy (作者)
一番调试 发现不设置method参数就能请求
1***@qq.com
我也是这样,我不设置methd参数也发送不了