uni-app导入@escook/request-miniprogram 请求接口报错TypeError: Cannot read property 'get' of undefined
//导入网络请求的包
import { $http } from '@escook/request-miniprogram'
uni.$http= $http;
//项目的根路径
$http.baseUrl = 'http://www.uinav.com'
//请求拦截器
$http.beforeRequest = function(options){
uni.showLoading({
title:"数据加载中"
})
}
//响应拦截器
$http.afterRequest = function(){
uni.hideLoading()
}
methods: {
async getSwiperList() {
const {data: res} = await uni.$http.get('/api/public/v1/home/swiperdata')
}
}