We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
直接按照实例引用报错
import axios from 'axios' import mpAdapter from 'axios-miniprogram-adapter' axios.defaults.adapter = mpAdapter const instance = axios.create({ baseURL: 'http://tms.vicici.com:9002/' }); // 添加请求拦截器 instance.interceptors.request.use(function (config) { // 在发送请求之前做些什么 return config; }, function (error) { // 对请求错误做些什么 return Promise.reject(error); }); // 添加响应拦截器 instance.interceptors.response.use(function (response) { // 对响应数据做点什么 return response; }, function (error) { // 对响应错误做点什么 return Promise.reject(error); }); export default instance;
尽可能提供在线例子
VM515:1 MiniProgramError Cannot read property 'defaults' of undefined TypeError: Cannot read property 'defaults' of undefined
小程序npm编译后的目录图如下
axios ├─ index.js └─ index.js.map
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题是什么
直接按照实例引用报错
环境
在线例子
尽可能提供在线例子
报错信息
小程序npm编译后的目录图如下
The text was updated successfully, but these errors were encountered: