From 17dc434350fbde235c1635e210a82053287a1e49 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Tue, 12 Apr 2022 12:04:54 +0800 Subject: [PATCH] no message --- resources/assets/js/App.vue | 13 ++++++++++--- resources/assets/js/pages/manage.vue | 17 +++++------------ .../js/pages/manage/components/FileContent.vue | 1 - .../assets/js/pages/manage/setting/index.vue | 10 +++++----- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index 126ee8ce0..44e1c248c 100755 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -22,7 +22,7 @@ export default { data() { return { - curPath: this.$route.path, + routePath: this.$route.path, transitionName: null, } }, @@ -63,7 +63,7 @@ export default { watch: { '$route'(To, From) { - this.curPath = To.path; + this.routePath = To.path; if (this.transitionName === null) { this.transitionName = 'app-slide-no'; return; @@ -74,7 +74,7 @@ export default { this.slideType(To, From); }, - curPath: { + routePath: { handler(path) { if (this.userId > 0) { path = path.replace(/^\/manage\/file\/\d+\/(\d+)$/, "/single/file/$1") @@ -83,6 +83,13 @@ export default { }, immediate: true }, + + userId: { + handler() { + this.$store.dispatch("websocketConnection") + }, + immediate: true + }, }, methods: { diff --git a/resources/assets/js/pages/manage.vue b/resources/assets/js/pages/manage.vue index 94b2dbc0f..5f9e5b67e 100644 --- a/resources/assets/js/pages/manage.vue +++ b/resources/assets/js/pages/manage.vue @@ -384,7 +384,7 @@ export default { return { loadIng: 0, - curPath: this.$route.path, + routePath: this.$route.path, mateName: /macintosh|mac os x/i.test(navigator.userAgent) ? '⌘' : 'Ctrl', addShow: false, @@ -614,7 +614,7 @@ export default { watch: { '$route' (route) { - this.curPath = route.path; + this.routePath = route.path; this.chackPass(); }, @@ -672,13 +672,6 @@ export default { immediate: true }, - userId: { - handler() { - this.$store.dispatch("websocketConnection") - }, - immediate: true - }, - wsMsg: { handler(info) { const {type, action} = info; @@ -782,7 +775,7 @@ export default { classNameRoute(path) { return { - "active": $A.leftExists(this.curPath, '/manage/' + path), + "active": $A.leftExists(this.routePath, '/manage/' + path), }; }, @@ -790,7 +783,7 @@ export default { let path = 'project/' + item.id; let openMenu = this.openMenu[item.id]; return { - "active": $A.leftExists(this.curPath, '/manage/' + path), + "active": $A.leftExists(this.routePath, '/manage/' + path), "open-menu": openMenu === true, "operate": item.id == this.topOperateItem.id && this.topOperateVisible }; @@ -881,7 +874,7 @@ export default { if (!this.natificationReady) { return; } - if (!this.natificationHidden && this.curPath == "/manage/messenger" && this.dialogOpenId == data.dialog_id) { + if (!this.natificationHidden && this.routePath == "/manage/messenger" && this.dialogOpenId == data.dialog_id) { return; } // diff --git a/resources/assets/js/pages/manage/components/FileContent.vue b/resources/assets/js/pages/manage/components/FileContent.vue index 908998081..5c4fde5f6 100644 --- a/resources/assets/js/pages/manage/components/FileContent.vue +++ b/resources/assets/js/pages/manage/components/FileContent.vue @@ -126,7 +126,6 @@ export default { return true } } - this.$store.dispatch("websocketConnection") } }, diff --git a/resources/assets/js/pages/manage/setting/index.vue b/resources/assets/js/pages/manage/setting/index.vue index 99d82cd31..e0b67ae22 100644 --- a/resources/assets/js/pages/manage/setting/index.vue +++ b/resources/assets/js/pages/manage/setting/index.vue @@ -46,7 +46,7 @@ import {Store} from "le5le-store"; export default { data() { return { - curPath: this.$route.path, + routePath: this.$route.path, show768Menu: true, version: window.systemInfo.version @@ -72,10 +72,10 @@ export default { }, titleNameRoute() { - const {curPath, menu} = this; + const {routePath, menu} = this; let name = ''; menu.some((item) => { - if ($A.leftExists(curPath, '/manage/setting/' + item.path)) { + if ($A.leftExists(routePath, '/manage/setting/' + item.path)) { name = item.name; return true; } @@ -85,7 +85,7 @@ export default { }, watch: { '$route' (route) { - this.curPath = route.path; + this.routePath = route.path; } }, methods: { @@ -100,7 +100,7 @@ export default { classNameRoute(path, divided) { return { - "active": $A.leftExists(this.curPath, '/manage/setting/' + path), + "active": $A.leftExists(this.routePath, '/manage/setting/' + path), "divided": !!divided }; },