mirror of
https://github.com/fugary/simple-element-plus-template.git
synced 2025-11-12 14:27:49 +00:00
处理登出跳转问题
This commit is contained in:
@@ -1,13 +1,17 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { useGlobalConfigStore } from '@/stores/GlobalConfigStore'
|
import { useGlobalConfigStore } from '@/stores/GlobalConfigStore'
|
||||||
import { useMenuConfigStore } from '@/stores/MenuConfigStore'
|
import { useMenuConfigStore } from '@/stores/MenuConfigStore'
|
||||||
|
import { useTabsViewStore } from '@/stores/TabsViewStore'
|
||||||
|
import { useBreadcrumbConfigStore } from '@/stores/BreadcrumbConfigStore'
|
||||||
import { GlobalLayoutMode } from '@/consts/GlobalConstants'
|
import { GlobalLayoutMode } from '@/consts/GlobalConstants'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
const globalConfigStore = useGlobalConfigStore()
|
const globalConfigStore = useGlobalConfigStore()
|
||||||
const menuConfigStore = useMenuConfigStore()
|
const menuConfigStore = useMenuConfigStore()
|
||||||
|
const tabsViewStore = useTabsViewStore()
|
||||||
|
const breadcrumbConfigStore = useBreadcrumbConfigStore()
|
||||||
|
|
||||||
const allMenus = computed(() => {
|
const allMenus = computed(() => {
|
||||||
const topMenus = menuConfigStore.loadBaseTopMenus().value
|
const topMenus = menuConfigStore.loadBaseTopMenus()
|
||||||
const businessMenus = menuConfigStore.calcBusinessMenus()
|
const businessMenus = menuConfigStore.calcBusinessMenus()
|
||||||
if (globalConfigStore.layoutMode === GlobalLayoutMode.TOP) {
|
if (globalConfigStore.layoutMode === GlobalLayoutMode.TOP) {
|
||||||
return [...businessMenus, ...topMenus.slice(1)]
|
return [...businessMenus, ...topMenus.slice(1)]
|
||||||
@@ -28,7 +32,11 @@ const allMenus = computed(() => {
|
|||||||
v-if="globalConfigStore.layoutMode === GlobalLayoutMode.LEFT && globalConfigStore.isShowBreadcrumb"
|
v-if="globalConfigStore.layoutMode === GlobalLayoutMode.LEFT && globalConfigStore.isShowBreadcrumb"
|
||||||
#split
|
#split
|
||||||
>
|
>
|
||||||
<common-breadcrumb :style="{'padding-left': '0','padding-top': '22px'}" />
|
<common-breadcrumb
|
||||||
|
:show-icon="tabsViewStore.isShowTabIcon"
|
||||||
|
:label-config="breadcrumbConfigStore.breadcrumbConfig"
|
||||||
|
:style="{'padding-left': '0','padding-top': '22px'}"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</common-menu>
|
</common-menu>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import stores from '@/stores'
|
|||||||
import icons from '@/icons'
|
import icons from '@/icons'
|
||||||
import messages from '@/messages'
|
import messages from '@/messages'
|
||||||
import commons from '@/components'
|
import commons from '@/components'
|
||||||
|
import utils from '@/utils'
|
||||||
|
|
||||||
import App from '@/App.vue'
|
import App from '@/App.vue'
|
||||||
import router from '@/route/routes'
|
import router from '@/route/routes'
|
||||||
@@ -23,6 +24,7 @@ app.use(ElementPlus)
|
|||||||
app.use(icons)
|
app.use(icons)
|
||||||
app.use(messages)
|
app.use(messages)
|
||||||
app.use(commons)
|
app.use(commons)
|
||||||
|
app.use(utils)
|
||||||
app.use(MonacoEditor)
|
app.use(MonacoEditor)
|
||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { defineStore } from 'pinia'
|
import { defineStore } from 'pinia'
|
||||||
import { ref } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
import { loadAndParseMenus, menu2CommonMenu, useBaseTopMenus } from '@/services/menu/MenuService'
|
import { loadAndParseMenus, menu2CommonMenu, useBaseTopMenus } from '@/services/menu/MenuService'
|
||||||
|
|
||||||
export const useMenuConfigStore = defineStore('menuConfig', () => {
|
export const useMenuConfigStore = defineStore('menuConfig', () => {
|
||||||
@@ -10,7 +10,7 @@ export const useMenuConfigStore = defineStore('menuConfig', () => {
|
|||||||
return {
|
return {
|
||||||
businessMenus,
|
businessMenus,
|
||||||
loadBaseTopMenus () {
|
loadBaseTopMenus () {
|
||||||
return ref(useBaseTopMenus())
|
return reactive(useBaseTopMenus())
|
||||||
},
|
},
|
||||||
async loadBusinessMenus () {
|
async loadBusinessMenus () {
|
||||||
businessMenus.value = await loadAndParseMenus()
|
businessMenus.value = await loadAndParseMenus()
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export const addParamsToURL = (url, params = {}) => {
|
|||||||
const baseUrl = hasParams ? url.substring(0, queryIndex) : url
|
const baseUrl = hasParams ? url.substring(0, queryIndex) : url
|
||||||
return `${baseUrl}?${toGetParams({ ...getParams, ...params })}`
|
return `${baseUrl}?${toGetParams({ ...getParams, ...params })}`
|
||||||
}
|
}
|
||||||
const router = null
|
let router = null
|
||||||
/**
|
/**
|
||||||
* @param {string|RouteLocationRaw|number} path 路径、路由对象、数字
|
* @param {string|RouteLocationRaw|number} path 路径、路由对象、数字
|
||||||
* @param replace 是否用replace方法
|
* @param replace 是否用replace方法
|
||||||
@@ -303,3 +303,29 @@ export const $copyText = (text) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
install (app) {
|
||||||
|
router = app.config.globalProperties.$router
|
||||||
|
Object.assign(app.config.globalProperties, {
|
||||||
|
$goto,
|
||||||
|
$reload,
|
||||||
|
$back: $goto,
|
||||||
|
$logout,
|
||||||
|
$date: formatDate,
|
||||||
|
$day: formatDay,
|
||||||
|
$number,
|
||||||
|
$currency,
|
||||||
|
$currencyShort,
|
||||||
|
$coreShowLoading,
|
||||||
|
$coreHideLoading,
|
||||||
|
$coreAlert,
|
||||||
|
$coreSuccess,
|
||||||
|
$coreWarning,
|
||||||
|
$coreError,
|
||||||
|
$coreConfirm,
|
||||||
|
$openNewWin,
|
||||||
|
$openWin
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user