From 98729cfa7bca3f61472c226076313d7c23f2747f Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 23 Mar 2022 10:40:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20Public=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E6=89=93=E5=BC=80=E7=A9=BA=E7=99=BD=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/pages/index.vue | 17 ++++++++++++++--- resources/assets/js/pages/login.vue | 17 ++++++++++------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/resources/assets/js/pages/index.vue b/resources/assets/js/pages/index.vue index d6170ae01..8d3b24cd6 100644 --- a/resources/assets/js/pages/index.vue +++ b/resources/assets/js/pages/index.vue @@ -203,6 +203,11 @@ export default { }, methods: { + isNotServer() { + let apiHome = $A.getDomain(window.systemInfo.apiUrl) + return this.$Electron && (apiHome == "" || apiHome == "public") + }, + setTheme(mode) { this.$store.dispatch("setTheme", mode) }, @@ -216,20 +221,26 @@ export default { }, getNeedStartHome() { + if (this.isNotServer()) { + this.needStartHome = false; + this.goForward({name: 'login'}, true); + return; + } this.$store.dispatch("call", { url: "system/get/starthome", }).then(({data}) => { this.homeFooter = data.home_footer; if (this.userId > 0) { - this.goForward({path: '/manage/dashboard'}, true); + this.goForward({name: 'manage-dashboard'}, true); } else { this.needStartHome = !!data.need_start; if (this.needStartHome === false) { - this.goForward({path: '/login'}, true); + this.goForward({name: 'login'}, true); } } - }).catch(() => { + }).catch(_ => { this.needStartHome = false; + this.goForward({name: 'login'}, true); }); }, }, diff --git a/resources/assets/js/pages/login.vue b/resources/assets/js/pages/login.vue index 0c0c1896f..909ac67d6 100644 --- a/resources/assets/js/pages/login.vue +++ b/resources/assets/js/pages/login.vue @@ -108,7 +108,7 @@ export default { this.getNeedStartHome(); // if (this.$Electron) { - this.chackServerUrl().catch(() => {}); + this.chackServerUrl().catch(_ => {}); } else { this.clearServerUrl(); } @@ -198,17 +198,20 @@ export default { this.email = data.account; this.password = data.password; } - }).catch(() => { + }).catch(_ => { // }); }, getNeedStartHome() { + if (this.isNotServer()) { + return; + } this.$store.dispatch("call", { url: "system/get/starthome", }).then(({data}) => { this.needStartHome = !!data.need_start; - }).catch(() => { + }).catch(_ => { this.needStartHome = false; }); }, @@ -218,7 +221,7 @@ export default { url: 'users/reg/needinvite', }).then(({data}) => { this.needInvite = !!data.need; - }).catch(() => { + }).catch(_ => { this.needInvite = false; }); }, @@ -305,7 +308,7 @@ export default { this.loadIng--; this.reCode(); this.codeNeed = true; - }).catch(() => { + }).catch(_ => { this.loadIng--; this.codeNeed = false; }); @@ -348,7 +351,7 @@ export default { $A.setStorage("cacheLoginEmail", this.email) this.$store.dispatch("handleClearCache", data).then(() => { this.goNext1(); - }).catch(() => { + }).catch(_ => { this.goNext1(); }); }).catch(({data, msg}) => { @@ -380,7 +383,7 @@ export default { }, }).then(() => { this.goNext2(); - }).catch(() => { + }).catch(_ => { this.goNext2(); }); }