master
xy 2 years ago
parent 0fb19c8f13
commit 5e2a9dd00e

@ -34,7 +34,7 @@
个人信息 个人信息
</el-dropdown-item> </el-dropdown-item>
</router-link> </router-link>
<el-dropdown-item divided @click.native="logout"> <el-dropdown-item v-if="!$store.state.app.isInElectron" class="user-logout" divided @click.native="logout">
<span style="display: block">退出</span> <span style="display: block">退出</span>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
@ -147,6 +147,9 @@ export default {
}, },
methods: { methods: {
async logout() { async logout() {
if (this.$store.state.app.isInElectron) {
return
}
await this.$store.dispatch('app/clearLayout') await this.$store.dispatch('app/clearLayout')
await this.$store.dispatch("user/logout"); await this.$store.dispatch("user/logout");
this.$router.push(`/login`); this.$router.push(`/login`);

@ -11,6 +11,7 @@ const state = {
}, },
device: "desktop", device: "desktop",
workerLayout: {}, workerLayout: {},
isInElectron: window.process?.versions?.hasOwnProperty("electron"),
isInIframe: false, isInIframe: false,
}; };
const getter = { const getter = {

Loading…
Cancel
Save