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.
 
 
 
 

25 lines
481 B

import urlConfig from '@/utils/config.js'
export default function $http(options) {
const { method, url, data } = options
return new Promise((reslove, reject) => {
uni.request({
method,
url: urlConfig + url,
data,
dataType: 'json'
}).then(res => {
if (res[1].data.success) {
reslove(res[1].data)
}else if(res[1].statusCode == 200){
reslove(res[1].data)
}
else {
reject(res[1].data)
}
}).catch(err => {
reject(err)
})
})
}