diff --git a/.env.development b/.env.development index 90ffbff..9551b19 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.107:5909 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/.env.development b/.env.development index 90ffbff..9551b19 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.107:5909 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/.env.production b/.env.production index 36e6ad3..7595683 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://111.198.10.15:21611 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/.env.development b/.env.development index 90ffbff..9551b19 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.107:5909 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/.env.production b/.env.production index 36e6ad3..7595683 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://111.198.10.15:21611 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index bdbb026..03b77dc 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.114:9527" + "baseUrl": "http://127.0.0.1:5909" } diff --git a/.env.development b/.env.development index 90ffbff..9551b19 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.107:5909 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/.env.production b/.env.production index 36e6ad3..7595683 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://111.198.10.15:21611 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index bdbb026..03b77dc 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.114:9527" + "baseUrl": "http://127.0.0.1:5909" } diff --git a/src/api/index.ts b/src/api/index.ts index 87d5969..7dfe88a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -24,7 +24,8 @@ } const request = axios.create({ - baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, + baseURL: window.localStorage.getItem('baseURL')!, + // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60, responseType: 'json', }) diff --git a/.env.development b/.env.development index 90ffbff..9551b19 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.107:5909 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/.env.production b/.env.production index 36e6ad3..7595683 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://111.198.10.15:21611 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index bdbb026..03b77dc 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.114:9527" + "baseUrl": "http://127.0.0.1:5909" } diff --git a/src/api/index.ts b/src/api/index.ts index 87d5969..7dfe88a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -24,7 +24,8 @@ } const request = axios.create({ - baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, + baseURL: window.localStorage.getItem('baseURL')!, + // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60, responseType: 'json', }) diff --git a/src/api/system/login.ts b/src/api/system/login.ts index 9b594da..e127482 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -24,6 +24,7 @@ // 登出 export function logout() { + window.localStorage.clear() // 清除loacalStorage所有数据 return request.get(`${prefix}user/logout`) } diff --git a/.env.development b/.env.development index 90ffbff..9551b19 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.107:5909 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/.env.production b/.env.production index 36e6ad3..7595683 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://111.198.10.15:21611 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index bdbb026..03b77dc 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.114:9527" + "baseUrl": "http://127.0.0.1:5909" } diff --git a/src/api/index.ts b/src/api/index.ts index 87d5969..7dfe88a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -24,7 +24,8 @@ } const request = axios.create({ - baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, + baseURL: window.localStorage.getItem('baseURL')!, + // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60, responseType: 'json', }) diff --git a/src/api/system/login.ts b/src/api/system/login.ts index 9b594da..e127482 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -24,6 +24,7 @@ // 登出 export function logout() { + window.localStorage.clear() // 清除loacalStorage所有数据 return request.get(`${prefix}user/logout`) } diff --git a/src/main.ts b/src/main.ts index 96c2b03..1e095de 100644 --- a/src/main.ts +++ b/src/main.ts @@ -41,6 +41,7 @@ console.log(result) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data + window.localStorage.setItem('baseURL', result.data.baseUrl) app.mount('#app') }).catch((error) => { console.error(`get baseConfig error...${error}`) diff --git a/.env.development b/.env.development index 90ffbff..9551b19 100644 --- a/.env.development +++ b/.env.development @@ -4,7 +4,7 @@ # 接口请求地址,会设置到 axios 的 baseURL 参数上 # VITE_APP_API_BASEURL = http://139.198.29.133:8089 # VITE_APP_API_BASEURL = http://111.198.10.15:21611 -VITE_APP_API_BASEURL = http://192.168.8.107:5909 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # VITE_APP_API_BASEURL = http://111.198.10.15:21710 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 diff --git a/.env.production b/.env.production index 36e6ad3..7595683 100644 --- a/.env.production +++ b/.env.production @@ -4,7 +4,7 @@ VITE_APP_TITLE = 计量信息系统 VITE_SYS_TITLE = 受检设备管理系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -VITE_APP_API_BASEURL = http://111.198.10.15:21611 +VITE_APP_API_BASEURL = http://127.0.0.1:5909 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/public/config/config.json b/public/config/config.json index bdbb026..03b77dc 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -1,4 +1,4 @@ { "title":"计量业务系统", - "baseUrl": "http://192.168.8.114:9527" + "baseUrl": "http://127.0.0.1:5909" } diff --git a/src/api/index.ts b/src/api/index.ts index 87d5969..7dfe88a 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -24,7 +24,8 @@ } const request = axios.create({ - baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, + baseURL: window.localStorage.getItem('baseURL')!, + // baseURL: import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL, timeout: 1000 * 60, responseType: 'json', }) diff --git a/src/api/system/login.ts b/src/api/system/login.ts index 9b594da..e127482 100644 --- a/src/api/system/login.ts +++ b/src/api/system/login.ts @@ -24,6 +24,7 @@ // 登出 export function logout() { + window.localStorage.clear() // 清除loacalStorage所有数据 return request.get(`${prefix}user/logout`) } diff --git a/src/main.ts b/src/main.ts index 96c2b03..1e095de 100644 --- a/src/main.ts +++ b/src/main.ts @@ -41,6 +41,7 @@ console.log(result) request.defaults.baseURL = result.data.baseUrl // 设置默认请求网址 app.config.globalProperties.config = result.data + window.localStorage.setItem('baseURL', result.data.baseUrl) app.mount('#app') }).catch((error) => { console.error(`get baseConfig error...${error}`) diff --git "a/\345\217\227\346\243\2000912.zip" "b/\345\217\227\346\243\2000912.zip" new file mode 100644 index 0000000..b6b86e1 --- /dev/null +++ "b/\345\217\227\346\243\2000912.zip" Binary files differ