From 9290a0a7023a612cddc5971553a6efb727a51165 Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期二, 19 八月 2025 17:34:58 +0800
Subject: [PATCH] qx
---
src/main.js | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/src/main.js b/src/main.js
index 42f906b..a98eff1 100644
--- a/src/main.js
+++ b/src/main.js
@@ -98,6 +98,22 @@
Vue.config.productionTip = false;
+let lastVersion = localStorage.getItem('appVersion');
+const checkVersion = async () => {
+ const res = await axios.get('/api/version'); // 杩斿洖褰撳墠鐗堟湰鍙�
+ if (res.data.version !== lastVersion) {
+ localStorage.setItem('appVersion', res.data.version);
+ // ElMessageBox.confirm('妫�娴嬪埌鏂扮増鏈紝鏄惁鍒锋柊锛�', '鎻愮ず', {
+ // confirmButtonText: '鍒锋柊',
+ // }).then(() => {
+ window.location.reload(true); // 寮哄埗鍒锋柊
+ // });
+ }
+};
+
+// 瀹氭椂妫�鏌ワ紙濡傛瘡灏忔椂涓�娆★級
+setInterval(checkVersion, 60 * 60 * 1000);
+
new Vue({
el: "#app",
router,
--
Gitblit v1.8.0