stanley-king 4 years ago
parent
commit
80d4a32b95
2 changed files with 9 additions and 4 deletions
  1. 8 2
      src/api/index.js
  2. 1 2
      vue.config.js

+ 8 - 2
src/api/index.js

@@ -74,7 +74,9 @@ axios.interceptors.response.use(
 
 Vue.prototype.$axios = axios;
 
-
+axios.defaults.headers.get['Pragma'] = 'no-cache';
+axios.defaults.headers.get['Cache-Control'] = 'no-cache, no-store'; 
+	
 let requestLoading = (url, method, params, showLoading = true) => {
     if (showLoading) {
         loading = context.$loading({
@@ -84,6 +86,8 @@ let requestLoading = (url, method, params, showLoading = true) => {
             background: 'rgba(0, 0, 0, 0.2)'
           });
     }
+
+	
     return axios({
         method: method,
         url: url,
@@ -96,8 +100,9 @@ let requestLoading = (url, method, params, showLoading = true) => {
 
 
 // const TestSrv = process.env.NODE_ENV == 'production' ? 'http://39.97.239.116:8080' : '/api';
-const StanleyLocal = process.env.NODE_ENV == 'production' ? 'http://zngapi.hemadj.com:8080' : '/api';
+// const StanleyLocal = process.env.NODE_ENV == 'production' ? 'http://zngapi.hemadj.com:8080' : '/api';
 // const StanleyLocal = process.env.NODE_ENV == 'production' ? 'http://192.168.1.200:8080' : '/api';
+const StanleyLocal = process.env.NODE_ENV == 'production' ? 'https://apizng.eavic.com' : '/api';
 
 const Prefix = StanleyLocal;
 
@@ -138,6 +143,7 @@ export const boxList = (params) => {
 
 //新增柜子
 export const addCabinet = (params) => {
+	console.log('call:',addCabinet);
     return requestLoading(`${Prefix}/AddCabinet`, 'post', params)
 }
 

+ 1 - 2
vue.config.js

@@ -1,4 +1,4 @@
-const targetUrl = 'http://zngapi.hemadj.com:8080';
+const targetUrl = 'https://apizng.eavic.com';
 
 module.exports = {
     publicPath:'./',
@@ -30,7 +30,6 @@ module.exports = {
                     '^/api': ''//请求的时候使用这个api就可以
                 }
             }
-
         }
     },
 }