shaogen1995 2 anni fa
parent
commit
88321e2a0f
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      yfyc/src/utils/request.js

+ 4 - 2
yfyc/src/utils/request.js

@@ -3,10 +3,10 @@ import {
   Toast
 } from "vant";
 // export const baseURL = process.env.NODE_ENV === 'development' ? 'http://192.168.20.55:8037' : ''             //线下地址
-export const baseURL = process.env.NODE_ENV === 'development' ? 'https://yifangyice.4dage.com' : ''             //线上地址
+export const baseURL = process.env.NODE_ENV === 'development' ? 'https://yifangyice.4dage.com' : '' //线上地址
 let axajInd = 0
 const service = axios.create({
-  baseURL: baseURL+'/api/',
+  baseURL: baseURL + '/api/',
   timeout: 50000
 })
 // 请求拦截器
@@ -42,6 +42,8 @@ service.interceptors.response.use(function (response) {
   return response.data
 }, function (error) {
   Toast.fail(error.message);
+  axajInd = 0
+  document.querySelector('.loadingApp').style.display = 'none'
   // 对响应错误做点什么
   return Promise.reject(error)
 })