You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
563 B

1 year ago
import urlConfig from './config.js'
const promise = {}
promise.asyncRequest = (url, options = {}, power) => {
return new Promise((resolve, reject) => {
uni.request({
url: url,
...options, //data,method...
header: {
"content-type": "application/json",
'withCredentials': true,
'Authorization': localStorage.token_type,
// 'Authorization': localStorage.token_type,
...options.header,
},
success: (res) => {
resolve(res.data);
},
fail: (err) => {
reject(err)
}
});
})
}
export default promise.asyncRequest