jiangping
2023-10-26 ea87c908fb6cdfc3e227a584a53e6730efb8262a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// 引入配置
import { baseUrl } from '@/common/config'
// 初始化请求配置
uni.$u.http.setConfig((defaultConfig) => {
    /* defaultConfig 为默认全局配置 */
    defaultConfig.baseURL = baseUrl /* 根域名 */
        defaultConfig.header = {
            'content-type': 'application/json;charset=utf-8',
        }
        defaultConfig.dataType = 'json'
    return defaultConfig
})
 
module.exports = (vm) => {
    require('./requestInterceptors')(vm)
    require('./responseInterceptors')(vm)
}