更新团课列表页面,修复路径代理导致的错误识别

This commit is contained in:
2026-06-04 19:11:00 +08:00
parent f0dda998a8
commit c4de871977
9 changed files with 7 additions and 17 deletions
+30
View File
@@ -0,0 +1,30 @@
// const BASE_URL = 'http://localhost:8080/api'
const BASE_URL = '/api'
export const request = (options) => {
return new Promise((resolve, reject) => {
uni.request({
url: BASE_URL + options.url,
method: options.method || 'GET',
data: options.data || {},
header: {
'Content-Type': 'application/json',
...options.header
},
success: (res) => {
if (res.statusCode === 200) {
resolve(res.data)
} else {
reject(res)
}
},
fail: (err) => {
reject(err)
}
})
})
}
export default {
request
}