|
@@ -2,8 +2,8 @@
|
|
import { RouterView } from 'vue-router'
|
|
import { RouterView } from 'vue-router'
|
|
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
|
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
|
import Confirm from '@/plugins/confirm'
|
|
import Confirm from '@/plugins/confirm'
|
|
-// import { testVersionFun } from './utils/testVersionFun'
|
|
|
|
import axios from 'axios'
|
|
import axios from 'axios'
|
|
|
|
+import { vue_version } from './version.js'
|
|
|
|
|
|
const timer = ref(null)
|
|
const timer = ref(null)
|
|
const setIntervalTime = 3000 // 接口调用间隔时间
|
|
const setIntervalTime = 3000 // 接口调用间隔时间
|
|
@@ -15,7 +15,7 @@ function open () {
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
// testVersionFun()
|
|
// testVersionFun()
|
|
- console.log('baseurl:', import.meta.env?.VITE_BASE_URL, 'version:', import.meta.env?.VITE_VERSION) // 打印
|
|
|
|
|
|
+ console.log('baseurl:', import.meta.env?.VITE_BASE_URL, 'vue_version:', vue_version) // 打印
|
|
const process_ENV = process?.env?.NODE_ENV || ''
|
|
const process_ENV = process?.env?.NODE_ENV || ''
|
|
if (process_ENV === 'production' || process_ENV === 'development') {
|
|
if (process_ENV === 'production' || process_ENV === 'development') {
|
|
open()
|
|
open()
|
|
@@ -30,17 +30,17 @@ let ConfirmDone = false
|
|
// 检查版本号
|
|
// 检查版本号
|
|
const checkVersion = () => {
|
|
const checkVersion = () => {
|
|
const baseUrl = import.meta.env.VITE_BASE_URL || ''
|
|
const baseUrl = import.meta.env.VITE_BASE_URL || ''
|
|
- const env_v = import.meta.env?.VITE_VERSION || ''
|
|
|
|
|
|
+ // const env_v = import.meta.env?.VITE_VERSION || ''
|
|
const tenantId = import.meta.env?.VITE_TENANTCODE || ''
|
|
const tenantId = import.meta.env?.VITE_TENANTCODE || ''
|
|
const get_v = localStorage.getItem('RES_VERSION') || ''
|
|
const get_v = localStorage.getItem('RES_VERSION') || ''
|
|
//
|
|
//
|
|
- if (!baseUrl || !env_v || !tenantId) return
|
|
|
|
|
|
+ if (!baseUrl || !vue_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 },
|
|
cache: 'no-store' // 禁用缓存
|
|
cache: 'no-store' // 禁用缓存
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
const res_v = res?.data?.data || ''
|
|
const res_v = res?.data?.data || ''
|
|
- if (!res_v || res_v === env_v ) { // 接口报错和版本一致不弹Confirm
|
|
|
|
|
|
+ if (!res_v || res_v === vue_version ) { // 接口报错和版本一致不弹Confirm
|
|
return
|
|
return
|
|
}
|
|
}
|
|
if (ConfirmDone) {
|
|
if (ConfirmDone) {
|