| | |
| | | // 引入配置
|
| | | import config from '@/common/config'
|
| | | import { baseUrl } from '@/common/config'
|
| | | // 初始化请求配置
|
| | | uni.$u.http.setConfig((defaultConfig) => {
|
| | | /* defaultConfig 为默认全局配置 */ |
| | | defaultConfig.baseURL = config.baseUrl /* 根域名 */ |
| | | config.header = { |
| | | 'content-type': 'application/x-www-form-urlencoded;charset=utf-8', |
| | | defaultConfig.baseURL = baseUrl /* 根域名 */ |
| | | defaultConfig.header = { |
| | | 'content-type': 'application/json;charset=utf-8', |
| | | } |
| | | config.dataType = 'json' |
| | | defaultConfig.dataType = 'json' |
| | | return defaultConfig
|
| | | })
|
| | |
|