http-requst.js 570 B

1234567891011121314151617181920212223242526
  1. // 引入vuex
  2. // import store from '@/common/store';
  3. // 引入拦截器配置
  4. import {requestInterceptors,responseInterceptors} from './interceptors.js'
  5. // 初始化请求配置
  6. const initRequest=(vm)=>{
  7. uni.$u.http.setConfig((defaultConfig) => {
  8. /* defaultConfig 为默认全局配置 */
  9. // defaultConfig.baseURL = "http://222.85.201.140:10001/" /* 根域名 */
  10. // 域名
  11. defaultConfig.baseURL = "https://jje.admin.xinyuekj.com.cn/" /* 根域名 */
  12. return defaultConfig;
  13. })
  14. requestInterceptors()
  15. responseInterceptors()
  16. }
  17. export {
  18. initRequest
  19. }