|
@@ -4,6 +4,7 @@ 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 testOpen = true
|
|
const timer = ref(null)
|
|
const timer = ref(null)
|
|
const autoCloseTime = 30000
|
|
const autoCloseTime = 30000
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
@@ -11,7 +12,7 @@ onMounted(() => {
|
|
console.log('baseurl', import.meta.env?.VITE_BASE_URL, 'version', import.meta.env?.VITE_VERSION)
|
|
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 === 'production') { // development production
|
|
|
|
|
|
+ if (process_ENV === 'production' || testOpen) { // development production
|
|
if (timer.value) clearInterval(timer.value)
|
|
if (timer.value) clearInterval(timer.value)
|
|
timer.value = setInterval(() => { checkVersion() }, autoCloseTime)
|
|
timer.value = setInterval(() => { checkVersion() }, autoCloseTime)
|
|
}
|
|
}
|
|
@@ -23,11 +24,13 @@ onUnmounted(() => {
|
|
|
|
|
|
// 检查版本号
|
|
// 检查版本号
|
|
const checkVersion = () => {
|
|
const checkVersion = () => {
|
|
- const baseUrl = import.meta.env.VITE_BASE_URL || 'https://www.menduner.com'
|
|
|
|
|
|
+ const baseUrl = import.meta.env.VITE_BASE_URL || ''
|
|
const version = import.meta.env?.VITE_VERSION || ''
|
|
const version = import.meta.env?.VITE_VERSION || ''
|
|
|
|
+ const tenantId = import.meta.env?.VITE_TENANTCODE || ''
|
|
|
|
+ if (!baseUrl || !version) return
|
|
axios.get(`${baseUrl}/app-api/menduner/system/get/version`, {
|
|
axios.get(`${baseUrl}/app-api/menduner/system/get/version`, {
|
|
headers: {
|
|
headers: {
|
|
- ['tenant-id']: import.meta.env.VITE_TENANTCODE
|
|
|
|
|
|
+ ['tenant-id']: tenantId
|
|
},
|
|
},
|
|
// cache: 'no-store' // 禁用缓存
|
|
// cache: 'no-store' // 禁用缓存
|
|
}).then((res) => {
|
|
}).then((res) => {
|