联调
This commit is contained in:
@@ -6,6 +6,7 @@ import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||
import { ElementPlusSize } from '@/types/elementPlus'
|
||||
import { LayoutType } from '@/types/layout'
|
||||
import { ThemeTypes } from '@/types/theme'
|
||||
import { getAppInfo } from '@/api/login'
|
||||
|
||||
const { wsCache } = useCache()
|
||||
|
||||
@@ -35,6 +36,7 @@ interface AppState {
|
||||
footer: boolean
|
||||
theme: ThemeTypes
|
||||
fixedMenu: boolean
|
||||
appInfo: any
|
||||
}
|
||||
|
||||
export const useAppStore = defineStore('app', {
|
||||
@@ -44,19 +46,20 @@ export const useAppStore = defineStore('app', {
|
||||
sizeMap: ['default', 'large', 'small'],
|
||||
mobile: false, // 是否是移动端
|
||||
title: import.meta.env.VITE_APP_TITLE, // 标题
|
||||
appInfo: wsCache.get('appInfo'),
|
||||
pageLoading: false, // 路由跳转loading
|
||||
|
||||
breadcrumb: true, // 面包屑
|
||||
breadcrumbIcon: true, // 面包屑图标
|
||||
breadcrumbIcon: false, // 面包屑图标
|
||||
collapse: false, // 折叠菜单
|
||||
uniqueOpened: true, // 是否只保持一个子菜单的展开
|
||||
hamburger: true, // 折叠图标
|
||||
screenfull: true, // 全屏图标
|
||||
size: true, // 尺寸图标
|
||||
locale: true, // 多语言图标
|
||||
size: false, // 尺寸图标
|
||||
locale: false, // 多语言图标
|
||||
message: true, // 消息图标
|
||||
tagsView: true, // 标签页
|
||||
tagsViewIcon: true, // 是否显示标签图标
|
||||
tagsViewIcon: false, // 是否显示标签图标
|
||||
logo: true, // logo
|
||||
fixedHeader: true, // 固定toolheader
|
||||
footer: false, // 显示页脚
|
||||
@@ -173,6 +176,9 @@ export const useAppStore = defineStore('app', {
|
||||
},
|
||||
getFooter(): boolean {
|
||||
return this.footer
|
||||
},
|
||||
getAppInfo(): any {
|
||||
return this.appInfo
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@@ -265,6 +271,12 @@ export const useAppStore = defineStore('app', {
|
||||
},
|
||||
setFooter(footer: boolean) {
|
||||
this.footer = footer
|
||||
},
|
||||
async setAppInfo(appId: number) {
|
||||
const appInfo = await getAppInfo(appId)
|
||||
wsCache.set('appInfo', appInfo)
|
||||
this.appInfo = appInfo
|
||||
return appInfo
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user