diff --git a/.env.development b/.env.development index 2bec093..a9f1c2e 100644 --- a/.env.development +++ b/.env.development @@ -5,4 +5,4 @@ ENV = 'development' VUE_APP_BASE_API = 'https://gb-test.ali251.langye.net' -#VUE_APP_BASE_API = 'https://gb-test.ali251.langye.net' +#VUE_APP_BASE_API = ' https://gbyuyue.szgmbwg.org.cn' diff --git a/.env.production b/.env.production index 9a8f863..3605b1d 100644 --- a/.env.production +++ b/.env.production @@ -4,4 +4,4 @@ ENV = 'production' # base api #VUE_APP_BASE_API = 'https://gb-test.ali251.langye.net' -VUE_APP_BASE_API = 'https://gb-test.ali251.langye.net' +VUE_APP_BASE_API = 'https://gbyuyue.szgmbwg.org.cn' diff --git a/src/utils/request.js b/src/utils/request.js index 280253e..bdb6177 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -7,12 +7,19 @@ import store from '@/store' import { getToken } from '@/utils/auth' - -// create an axios instance -const service = axios.create({ - baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url - // withCredentials: true, // send cookies when cross-domain requests - timeout: 50000 // request timeout + + +let baseUrl = '' +if(window.location.origin.indexOf('localhost')>-1){ + baseUrl = process.env.VUE_APP_BASE_API +}else{ + baseUrl = window.location.origin + '/' +} +const service = axios.create({ + baseURL: baseUrl, // url = base url + request url + // withCredentials: true, // send cookies when cross-domain requests + timeout: 50000, // request timeout + // isLoading:true }) // request interceptor diff --git a/src/views/exhibit/component/addExhibit.vue b/src/views/exhibit/component/addExhibit.vue index af257ba..a14b386 100644 --- a/src/views/exhibit/component/addExhibit.vue +++ b/src/views/exhibit/component/addExhibit.vue @@ -91,9 +91,11 @@ 结束时间: