index.js 341 B

123456789101112131415
  1. // 引入配置
  2. import {
  3. config
  4. } from '@/common/config'
  5. // 初始化请求配置
  6. uni.$u.http.setConfig((defaultConfig) => {
  7. /* defaultConfig 为默认全局配置 */
  8. defaultConfig.baseURL = config.baseUrl
  9. return defaultConfig
  10. })
  11. module.exports = (vm) => {
  12. require('./requestInterceptors')(vm)
  13. require('./responseInterceptors')(vm)
  14. }