axios 封装
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
|
||||
const serverHost = 'https://api-ugo-web.itheima.net'
|
||||
const serverHost = 'https://pupil.hchyun.com/api' // https://api-ugo-web.itheima.net'
|
||||
function isOutTime(res) {
|
||||
if (res.data.message === '请先登录') {
|
||||
uni.showToast('登录信息已过期,请重新登录')
|
||||
@@ -40,7 +40,6 @@ const service = {
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
post(url, data, isLogin) {
|
||||
const header = {}
|
||||
if (isLogin) {
|
||||
@@ -184,9 +183,9 @@ const apiService = {
|
||||
},
|
||||
// 获取
|
||||
getCategories(data) {
|
||||
const url = `/api/public/v1/categories`
|
||||
const url = `/home/classlist`
|
||||
return new Promise((resolve, reject) => {
|
||||
resolve(service.get(url, data))
|
||||
resolve(service.get(url))
|
||||
})
|
||||
},
|
||||
// 新增
|
||||
|
||||
Reference in New Issue
Block a user