|
@@ -332,6 +332,7 @@ import NavMenu from "./components/NavMenu.vue";
|
|
|
import NavMenu2 from "./components/NavMenu2.vue";
|
|
import NavMenu2 from "./components/NavMenu2.vue";
|
|
|
import userbar from "./components/userbar.vue";
|
|
import userbar from "./components/userbar.vue";
|
|
|
import iframeView from "./components/iframeView.vue";
|
|
import iframeView from "./components/iframeView.vue";
|
|
|
|
|
+import { checkVersion, startPolling, stopPolling } from "@/utils/versionCheck";
|
|
|
export default {
|
|
export default {
|
|
|
name: "index",
|
|
name: "index",
|
|
|
components: {
|
|
components: {
|
|
@@ -385,6 +386,18 @@ export default {
|
|
|
var menu = this.$router.getMenu();
|
|
var menu = this.$router.getMenu();
|
|
|
this.menu = this.filterUrl(menu);
|
|
this.menu = this.filterUrl(menu);
|
|
|
this.showThis();
|
|
this.showThis();
|
|
|
|
|
+ checkVersion().then(hasUpdate => {
|
|
|
|
|
+ if (hasUpdate) {
|
|
|
|
|
+ this.$notify.info({
|
|
|
|
|
+ title: '系统更新',
|
|
|
|
|
+ message: '检测到新版本,正在刷新...',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ });
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ window.location.reload();
|
|
|
|
|
+ }, 2000);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
$route() {
|
|
$route() {
|
|
@@ -408,6 +421,10 @@ export default {
|
|
|
this.fixTopMenu();
|
|
this.fixTopMenu();
|
|
|
window.addEventListener("resize", this.fixTopMenu);
|
|
window.addEventListener("resize", this.fixTopMenu);
|
|
|
}
|
|
}
|
|
|
|
|
+ startPolling();
|
|
|
|
|
+ },
|
|
|
|
|
+ beforeDestroy() {
|
|
|
|
|
+ stopPolling();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
fixTopMenu() {
|
|
fixTopMenu() {
|