fix: Public客户端打开空白的情况

This commit is contained in:
kuaifan 2022-03-23 10:40:02 +08:00
parent 2bd077136f
commit 98729cfa7b
2 changed files with 24 additions and 10 deletions

View File

@ -203,6 +203,11 @@ export default {
}, },
methods: { methods: {
isNotServer() {
let apiHome = $A.getDomain(window.systemInfo.apiUrl)
return this.$Electron && (apiHome == "" || apiHome == "public")
},
setTheme(mode) { setTheme(mode) {
this.$store.dispatch("setTheme", mode) this.$store.dispatch("setTheme", mode)
}, },
@ -216,20 +221,26 @@ export default {
}, },
getNeedStartHome() { getNeedStartHome() {
if (this.isNotServer()) {
this.needStartHome = false;
this.goForward({name: 'login'}, true);
return;
}
this.$store.dispatch("call", { this.$store.dispatch("call", {
url: "system/get/starthome", url: "system/get/starthome",
}).then(({data}) => { }).then(({data}) => {
this.homeFooter = data.home_footer; this.homeFooter = data.home_footer;
if (this.userId > 0) { if (this.userId > 0) {
this.goForward({path: '/manage/dashboard'}, true); this.goForward({name: 'manage-dashboard'}, true);
} else { } else {
this.needStartHome = !!data.need_start; this.needStartHome = !!data.need_start;
if (this.needStartHome === false) { if (this.needStartHome === false) {
this.goForward({path: '/login'}, true); this.goForward({name: 'login'}, true);
} }
} }
}).catch(() => { }).catch(_ => {
this.needStartHome = false; this.needStartHome = false;
this.goForward({name: 'login'}, true);
}); });
}, },
}, },

View File

@ -108,7 +108,7 @@ export default {
this.getNeedStartHome(); this.getNeedStartHome();
// //
if (this.$Electron) { if (this.$Electron) {
this.chackServerUrl().catch(() => {}); this.chackServerUrl().catch(_ => {});
} else { } else {
this.clearServerUrl(); this.clearServerUrl();
} }
@ -198,17 +198,20 @@ export default {
this.email = data.account; this.email = data.account;
this.password = data.password; this.password = data.password;
} }
}).catch(() => { }).catch(_ => {
// //
}); });
}, },
getNeedStartHome() { getNeedStartHome() {
if (this.isNotServer()) {
return;
}
this.$store.dispatch("call", { this.$store.dispatch("call", {
url: "system/get/starthome", url: "system/get/starthome",
}).then(({data}) => { }).then(({data}) => {
this.needStartHome = !!data.need_start; this.needStartHome = !!data.need_start;
}).catch(() => { }).catch(_ => {
this.needStartHome = false; this.needStartHome = false;
}); });
}, },
@ -218,7 +221,7 @@ export default {
url: 'users/reg/needinvite', url: 'users/reg/needinvite',
}).then(({data}) => { }).then(({data}) => {
this.needInvite = !!data.need; this.needInvite = !!data.need;
}).catch(() => { }).catch(_ => {
this.needInvite = false; this.needInvite = false;
}); });
}, },
@ -305,7 +308,7 @@ export default {
this.loadIng--; this.loadIng--;
this.reCode(); this.reCode();
this.codeNeed = true; this.codeNeed = true;
}).catch(() => { }).catch(_ => {
this.loadIng--; this.loadIng--;
this.codeNeed = false; this.codeNeed = false;
}); });
@ -348,7 +351,7 @@ export default {
$A.setStorage("cacheLoginEmail", this.email) $A.setStorage("cacheLoginEmail", this.email)
this.$store.dispatch("handleClearCache", data).then(() => { this.$store.dispatch("handleClearCache", data).then(() => {
this.goNext1(); this.goNext1();
}).catch(() => { }).catch(_ => {
this.goNext1(); this.goNext1();
}); });
}).catch(({data, msg}) => { }).catch(({data, msg}) => {
@ -380,7 +383,7 @@ export default {
}, },
}).then(() => { }).then(() => {
this.goNext2(); this.goNext2();
}).catch(() => { }).catch(_ => {
this.goNext2(); this.goNext2();
}); });
} }