index.js 880 B

1234567891011121314151617181920212223242526272829303132333435
  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. // 数趣Ai项目接口根路径
  8. // config.baseURL = 'https://www.ai5566.top/api/'
  9. // 本地
  10. // config.baseURL = 'http://192.168.31.102/'
  11. // 线上
  12. //config.baseURL = 'https://meta.swdz.com/'
  13. //测试
  14. config.baseURL='https://t.scxxq.cn/index.php/'
  15. config.header = {
  16. // 'Content-Type': 'application/x-www-form-urlencoded',
  17. 'Content-type': 'application/json',
  18. 'X-Requested-With': 'XMLHttpRequest',
  19. 'Accept': 'application/vnd.api.v1+json'
  20. }
  21. // if (store.getters.token) {
  22. if (true) {
  23. // config.header['Authorization'] = store.getters.token
  24. }
  25. return config
  26. })
  27. module.exports = (vm) => {
  28. require('./requestInterceptors')(vm)
  29. require('./responseInterceptors')(vm)
  30. }