// 引入配置 import config from '@/common/config.js' // import store from '@/store' uni.$u.http.setConfig((config) => { console.log('到config配置'); /* config 为默认全局配置 */ // 数趣Ai项目接口根路径 // config.baseURL = 'https://www.ai5566.top/api/' // 本地 config.baseURL = 'http://192.168.31.102/' // 线上 config.baseURL = 'http://t3.9026.com/' config.header = { // 'Content-Type': 'application/x-www-form-urlencoded', 'Content-type': 'application/json', 'X-Requested-With': 'XMLHttpRequest', 'Accept': 'application/vnd.api.v1+json' } // if (store.getters.token) { if (true) { // config.header['Authorization'] = store.getters.token } return config }) module.exports = (vm) => { require('./requestInterceptors')(vm) require('./responseInterceptors')(vm) }