chore: scaffold linhelp applications

This commit is contained in:
王鹏
2026-07-07 15:06:33 +08:00
parent 95685efa82
commit edffda2a84
70 changed files with 537 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
function request(options) {
const app = getApp()
const token = app.globalData.token
return new Promise((resolve, reject) => {
wx.request({
url: app.globalData.apiBaseUrl + options.url,
method: options.method || 'GET',
data: options.data || {},
header: Object.assign({
Authorization: token
}, options.header || {}),
success(res) {
if (res.statusCode >= 200 && res.statusCode < 300 && res.data && res.data.code === 0) {
resolve(res.data.data)
return
}
reject(new Error((res.data && res.data.message) || '请求失败'))
},
fail: reject
})
})
}
module.exports = {
request
}