|
@@ -4,15 +4,15 @@ import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
|
import Confirm from '@/plugins/confirm'
|
|
import Confirm from '@/plugins/confirm'
|
|
import axios from 'axios'
|
|
import axios from 'axios'
|
|
|
|
|
|
-const testVersion = '' // 开启测试环境测试 (默认为空关闭测试,v24.11.07.1936测试使用)
|
|
|
|
|
|
+const openCheckVersion = true // 开启检测版本
|
|
const timer = ref(null)
|
|
const timer = ref(null)
|
|
-const setIntervalTime = 10000 // 300000 五分钟
|
|
|
|
|
|
+const setIntervalTime = 300000 // 300000 五分钟
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
- console.log('baseurl:', import.meta.env?.VITE_BASE_URL, 'version:', import.meta.env?.VITE_VERSION || testVersion)
|
|
|
|
|
|
+ console.log('baseurl:', import.meta.env?.VITE_BASE_URL, 'version:', import.meta.env?.VITE_VERSION)
|
|
//
|
|
//
|
|
const process_ENV = process?.env?.NODE_ENV || ''
|
|
const process_ENV = process?.env?.NODE_ENV || ''
|
|
- if (process_ENV === 'development' || testVersion) { // development production
|
|
|
|
|
|
+ if ((process_ENV === 'production' || process_ENV === 'development') && openCheckVersion) {
|
|
if (timer.value) clearInterval(timer.value)
|
|
if (timer.value) clearInterval(timer.value)
|
|
timer.value = setInterval(() => { checkVersion() }, setIntervalTime)
|
|
timer.value = setInterval(() => { checkVersion() }, setIntervalTime)
|
|
}
|
|
}
|
|
@@ -25,9 +25,10 @@ onUnmounted(() => {
|
|
// 检查版本号
|
|
// 检查版本号
|
|
const checkVersion = () => {
|
|
const checkVersion = () => {
|
|
const baseUrl = import.meta.env.VITE_BASE_URL || ''
|
|
const baseUrl = import.meta.env.VITE_BASE_URL || ''
|
|
- const version = import.meta.env?.VITE_VERSION || testVersion
|
|
|
|
|
|
+ const version = import.meta.env?.VITE_VERSION || ''
|
|
const tenantId = import.meta.env?.VITE_TENANTCODE || ''
|
|
const tenantId = import.meta.env?.VITE_TENANTCODE || ''
|
|
- if (!baseUrl || !version) return
|
|
|
|
|
|
+ //
|
|
|
|
+ if (!baseUrl || !version || !tenantId) return
|
|
axios.get(`${baseUrl}/app-api/menduner/system/get/version`, {
|
|
axios.get(`${baseUrl}/app-api/menduner/system/get/version`, {
|
|
headers: { ['tenant-id']: tenantId }
|
|
headers: { ['tenant-id']: tenantId }
|
|
}).then((res) => {
|
|
}).then((res) => {
|