Skip to content

Commit

Permalink
fix: Public客户端打开空白的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Mar 23, 2022
1 parent 2bd0771 commit 98729cf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
17 changes: 14 additions & 3 deletions resources/assets/js/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand All @@ -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);
});
},
},
Expand Down
17 changes: 10 additions & 7 deletions resources/assets/js/pages/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default {
this.getNeedStartHome();
//
if (this.$Electron) {
this.chackServerUrl().catch(() => {});
this.chackServerUrl().catch(_ => {});
} else {
this.clearServerUrl();
}
Expand Down Expand Up @@ -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;
});
},
Expand All @@ -218,7 +221,7 @@ export default {
url: 'users/reg/needinvite',
}).then(({data}) => {
this.needInvite = !!data.need;
}).catch(() => {
}).catch(_ => {
this.needInvite = false;
});
},
Expand Down Expand Up @@ -305,7 +308,7 @@ export default {
this.loadIng--;
this.reCode();
this.codeNeed = true;
}).catch(() => {
}).catch(_ => {
this.loadIng--;
this.codeNeed = false;
});
Expand Down Expand Up @@ -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}) => {
Expand Down Expand Up @@ -380,7 +383,7 @@ export default {
},
}).then(() => {
this.goNext2();
}).catch(() => {
}).catch(_ => {
this.goNext2();
});
}
Expand Down

0 comments on commit 98729cf

Please sign in to comment.