1234567891011121314151617181920212223242526272829303132333435363738394041 |
- // 引入配置
- 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/'
- /* 根域名 */
- if (process.env.NODE_ENV === 'development') {
- console.log('开发环境---------------------');
- config.baseURL = 'https://t20.9026.com/api/'
- }
- if (process.env.NODE_ENV === 'production') {
- console.log('生产环境------------------');
- config.baseURL = 'https://t20.9026.com/api/'
- // config.baseURL = 'https://www.ai5566.top/api/'
- }
- 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)
- }
|