租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

16 lines
512 B

// 引入配置
import config from '@/common/config'
// 引入请求拦截
import { requestInterceptors } from './requestInterceptors.js'
// 引入响应拦截
import { responseInterceptors } from './responseInterceptors.js'
// 初始化请求配置
export const Request = ()=>{
uni.$uv.http.setConfig((defaultConfig) => {
/* defaultConfig 为默认全局配置 */
defaultConfig.baseURL = config.baseUrl /* 根域名 */
return defaultConfig
})
requestInterceptors();
responseInterceptors();
}