//common\request.js
function request(url, method = "GET", data = {}, header = {}) {
return new Promise((resolve, reject) => {
uni.request({
url,
data,
method,
header,
dataType: "json",
responseType: "text",
success: e => resolve(e),
fail: e => reject(e)
})
})
}
export default request
//import request from "./request.js";
uni-app学习笔记之request请求封装
最新推荐文章于 2023-05-08 08:59:56 发布