index.js 784 B

12345678910111213141516171819202122232425262728293031323334
  1. // 引入配置
  2. // import config from '@/common/config.js'
  3. // import store from '@/store'
  4. uni.$u.http.setConfig((config) => {
  5. console.log('到config配置');
  6. /* config 为默认全局配置 */
  7. // config.baseURL = 'https://t18.9026.com/api'
  8. config.baseURL = 'https://hb.swdz.com/api/'
  9. // config.baseURL = 'http://jmapi.tangyuhao.cn/index.php'
  10. config.header = {
  11. // 'Content-Type': 'application/x-www-form-urlencoded',
  12. 'Content-type': 'application/json',
  13. 'X-Requested-With': 'XMLHttpRequest',
  14. 'Accept': 'application/vnd.api.v1+json'
  15. }
  16. // if (store.getters.token) {
  17. if (true) {
  18. // config.header['Authorization'] = store.getters.token
  19. }
  20. return config
  21. })
  22. module.exports = (vm) => {
  23. require('./requestInterceptors')(vm)
  24. require('./responseInterceptors')(vm)
  25. }