mirror of
https://github.com/blossom-editor/blossom
synced 2024-11-17 22:48:03 +08:00
feat: 登录后是否自动跳转至首页的配置项
This commit is contained in:
parent
e071100dd5
commit
cbd0343dd5
@ -30,6 +30,8 @@ export interface ViewStyle {
|
|||||||
isShowTryuseBtn: boolean
|
isShowTryuseBtn: boolean
|
||||||
// 只展开一项子菜单
|
// 只展开一项子菜单
|
||||||
isMenuUniqueOpened: boolean
|
isMenuUniqueOpened: boolean
|
||||||
|
// 点击登录后自动进入首页
|
||||||
|
isLoginToHomePage: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,7 +111,8 @@ export const useConfigStore = defineStore('configStore', {
|
|||||||
isWebCollectCard: true,
|
isWebCollectCard: true,
|
||||||
isGlobalShadow: false,
|
isGlobalShadow: false,
|
||||||
isShowTryuseBtn: true,
|
isShowTryuseBtn: true,
|
||||||
isMenuUniqueOpened: true
|
isMenuUniqueOpened: true,
|
||||||
|
isLoginToHomePage: false
|
||||||
},
|
},
|
||||||
...Local.get(VIEW_STYLE_KEY)
|
...Local.get(VIEW_STYLE_KEY)
|
||||||
},
|
},
|
||||||
|
@ -78,6 +78,12 @@
|
|||||||
|
|
||||||
<el-form label-position="right" label-width="130px" style="max-width: 800px">
|
<el-form label-position="right" label-width="130px" style="max-width: 800px">
|
||||||
<bl-row just="flex-start" class="config-module-titile"><span class="iconbl bl-apps-line"></span>其他</bl-row>
|
<bl-row just="flex-start" class="config-module-titile"><span class="iconbl bl-apps-line"></span>其他</bl-row>
|
||||||
|
<el-form-item label="登录后进入首页">
|
||||||
|
<bl-row>
|
||||||
|
<el-switch v-model="configViewStyleForm.isLoginToHomePage" size="default" style="margin-right: 10px" @change="changeViewStyle" />
|
||||||
|
</bl-row>
|
||||||
|
<div class="conf-tip">点击登录按钮后,是否自动跳转至首页。</div>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="开发者工具">
|
<el-form-item label="开发者工具">
|
||||||
<bl-row>
|
<bl-row>
|
||||||
<el-button @click="openDevTools"><span class="iconbl bl-bug-line" @click="openDevTools"></span></el-button>
|
<el-button @click="openDevTools"><span class="iconbl bl-bug-line" @click="openDevTools"></span></el-button>
|
||||||
|
@ -78,6 +78,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import router from '@renderer/router'
|
||||||
import { computed, nextTick, onMounted, ref } from 'vue'
|
import { computed, nextTick, onMounted, ref } from 'vue'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { useDark } from '@vueuse/core'
|
import { useDark } from '@vueuse/core'
|
||||||
@ -116,6 +117,9 @@ const login = async () => {
|
|||||||
}
|
}
|
||||||
logingIn.value = true
|
logingIn.value = true
|
||||||
await userStore.loginByPassword(formLogin.value.username, formLogin.value.password)
|
await userStore.loginByPassword(formLogin.value.username, formLogin.value.password)
|
||||||
|
if (configStore.viewStyle.isLoginToHomePage) {
|
||||||
|
router.push('/home')
|
||||||
|
}
|
||||||
logingIn.value = false
|
logingIn.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
.el-form {
|
.el-form {
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
margin-bottom: 100px;
|
margin-bottom: 50px;
|
||||||
:deep(.el-form-item__label) {
|
:deep(.el-form-item__label) {
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user