初始化项目

This commit is contained in:
2025-11-26 17:42:45 +08:00
commit 65ecc68767
2513 changed files with 1313954 additions and 0 deletions

30
Web/lib/request.js Normal file
View File

@@ -0,0 +1,30 @@
//请求数量
let show = 0;
export default async function reqeust(params) {
show++;
return new Promise((resolve, reject) => {
// wx.showLoading({
// title: params.title,
// mask:true
// })
wx.request({
url: params.url,
method: params.method || 'post',
data: params.data || {},
success: res => {
resolve(res.data)
},
fail: err => {
reject(err)
},
complete:()=>{
show--;
if(show==0){
wx.hideLoading()
}
}
})
}).catch((error) => {
throw new Error(error);
})
}