diff --git a/nezha-fronted/src/App.vue b/nezha-fronted/src/App.vue index b2e79f0d6..ed29502f4 100644 --- a/nezha-fronted/src/App.vue +++ b/nezha-fronted/src/App.vue @@ -10,16 +10,22 @@ export default { name: 'App', mounted() { - // this.$http.get("config.json").then((result)=>{ - // this.$axios.defaults.baseURL = result.body.baseUrl; - // const version=result.body.version; - // if(version!==localStorage.getItem('nz-version')){ - // sessionStorage.clear(); - // localStorage.clear(); - // localStorage.setItem('nz-version',version); - // } - // }); - this.$axios.defaults.baseURL = 'http://192.168.40.42:8080/nz-admin'; + let development=process.env.NODE_ENV == 'development' ? true : false;//用于区分是本地开发还是线上环境 + console.log(process,development); + if(development){ + this.$axios.defaults.baseURL = 'http://192.168.40.42:8080/nz-admin'; + } else{ + const Timestamp=new Date().getTime(); + this.$http.get("config.json?Timestamp="+Timestamp).then((result)=>{ + this.$axios.defaults.baseURL = result.body.baseUrl; + const version=result.body.version; + if(version!==localStorage.getItem('nz-version')){ + sessionStorage.clear(); + localStorage.clear(); + localStorage.setItem('nz-version',version); + } + }); + } } } diff --git a/nezha-fronted/src/components/charts/chart-detail.vue b/nezha-fronted/src/components/charts/chart-detail.vue index 322eff91a..1c8710714 100644 --- a/nezha-fronted/src/components/charts/chart-detail.vue +++ b/nezha-fronted/src/components/charts/chart-detail.vue @@ -467,7 +467,6 @@ this.panelIdInner = panelId; this.data = chartItem; - console.log(detail); this.detail = detail; if (this.detail[0] && this.detail[0].type && this.detail[0].type == "endpointInfo") { //endpointInfo的小图表 this.$nextTick(() => { diff --git a/nezha-fronted/src/http.js b/nezha-fronted/src/http.js index d1a698980..a54060f20 100644 --- a/nezha-fronted/src/http.js +++ b/nezha-fronted/src/http.js @@ -16,14 +16,6 @@ axios.interceptors.request.use(config => { if (token) { config.headers['Authorization'] = token //请求头token } - config.data={ - ...(config.data||{}), - _t:new Date().getTime(), - }; - config.params={ - ...(config.params||{}), - _t:new Date().getTime(), - }; return config; }, err => Promise.reject(err)