rqs.js
493 字节
const BASE_URL = 'http://www.xide.com';
export const rqs = (url, data, method) => {
return new Promise((resolve, reject) => {
uni.request({
url: BASE_URL + url,
data: data || {},
method: method || 'POST',
header: {
token: uni.getStorageSync('token'),
// token: '2a6395f8-390e-4893-b4af-a5f63e75bdd8',
success: (res) => {
console.log('调用成功');
resolve(res)
},
fail: (err) => {
console.log('调用失败');
reject(err)
}
}
})
})
}