123456789101112131415161718192021222324252627 |
- import {
- requestInterceptors,
- responseInterceptors
- } from './interceptors.js'
- import {
- http
- } from '@/uni_modules/uview-plus'
- const initRequest = (vm) => {
- http.setConfig((defaultConfig) => {
-
- if (process.env.NODE_ENV === 'development') {
- defaultConfig.baseURL = '/api'
- }
- if (process.env.NODE_ENV === 'production') {
- defaultConfig.baseURL = '/api'
- }
- return defaultConfig
- })
- requestInterceptors()
- responseInterceptors()
- }
- export {
- initRequest
- }
|