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(); }); }