mirror of
https://github.com/MCSManager/UI.git
synced 2025-02-17 18:39:30 +08:00
Fix: redirect to install page
This commit is contained in:
parent
d29cfa3043
commit
1b74e0a190
@ -43,6 +43,7 @@ Copyright (C) 2022 MCSManager <mcsmanager-dev@outlook.com>
|
||||
<script>
|
||||
import Aside from "../components/Aside";
|
||||
import Header from "../components/Header";
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
import { requestPanelStatus, setupUserInfo } from "./service/protocol.js";
|
||||
import router from "./router";
|
||||
|
||||
@ -73,7 +74,6 @@ export default {
|
||||
|
||||
async created() {
|
||||
let needToRoot = false;
|
||||
let needInstall = false;
|
||||
|
||||
try {
|
||||
// After the first refresh, try to get user data once
|
||||
@ -86,23 +86,7 @@ export default {
|
||||
needToRoot = true;
|
||||
}
|
||||
|
||||
try {
|
||||
// Get current panel status information
|
||||
const statusInfo = await requestPanelStatus();
|
||||
if (statusInfo.language) {
|
||||
console.log("SET_LANGUAGE:", statusInfo.language);
|
||||
this.$i18n.locale = statusInfo.language;
|
||||
} else {
|
||||
this.$i18n.locale = "en_us";
|
||||
}
|
||||
// If not installed, must route to /install
|
||||
if (statusInfo?.isInstall === false) needInstall = true;
|
||||
} catch (error) {
|
||||
alert(error + " Please refresh!");
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
if (needInstall) return router.push({ path: "/install" });
|
||||
if (needToRoot) return router.push({ path: "/" });
|
||||
},
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
</ItemGroup>
|
||||
</div>
|
||||
</Panel>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-wrapper" v-if="step == 0">
|
||||
<Panel class="panel tc" body-style="padding:40px;">
|
||||
@ -159,7 +159,6 @@ export default {
|
||||
window.location.href = "/#/overview?from_install=1";
|
||||
},
|
||||
installLib() {
|
||||
console.log("install....");
|
||||
this.next();
|
||||
},
|
||||
async selectLanguage(lang) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
<script>
|
||||
import Panel from "../../components/Panel";
|
||||
import router from "../router";
|
||||
import { setupUserInfo } from "../service/protocol";
|
||||
import { requestPanelStatus, setupUserInfo } from "../service/protocol";
|
||||
|
||||
export default {
|
||||
components: { Panel },
|
||||
@ -30,6 +30,21 @@ export default {
|
||||
}
|
||||
},
|
||||
async init() {
|
||||
try {
|
||||
// Get current panel status information
|
||||
const statusInfo = await requestPanelStatus();
|
||||
if (statusInfo.language) {
|
||||
console.log("SET_LANGUAGE:", statusInfo.language, statusInfo);
|
||||
this.$i18n.locale = statusInfo.language;
|
||||
} else {
|
||||
this.$i18n.locale = "en_us";
|
||||
}
|
||||
// If not installed, must route to /install
|
||||
if (statusInfo?.isInstall === false) return router.push({ path: "/install" });
|
||||
} catch (error) {
|
||||
alert(`Err: ${error}, Please refresh!`);
|
||||
}
|
||||
|
||||
try {
|
||||
// In order to adapt to seamless login, data must be requested again here
|
||||
if (this.$store.state.userInfo?.permission && this.$store.state.userInfo?.uuid)
|
||||
|
Loading…
Reference in New Issue
Block a user