feat: Permission

This commit is contained in:
wangdan-fit2cloud 2025-06-16 19:56:52 +08:00
parent 1b5d0f78ef
commit 310fd12e87
3 changed files with 14 additions and 6 deletions

View File

@ -4,8 +4,12 @@
<div class="logo mt-4"> <div class="logo mt-4">
<LogoFull /> <LogoFull />
</div> </div>
<el-divider direction="vertical" class="ml-24 mr-24" /> <el-divider
<Workspace /> direction="vertical"
class="ml-24 mr-24"
v-if="hasPermission(EditionConst.IS_EE, 'OR')"
/>
<WorkspaceDropdown v-if="hasPermission(EditionConst.IS_EE, 'OR')" />
<div class="flex-between w-full"> <div class="flex-between w-full">
<div></div> <div></div>
<TopMenu></TopMenu> <TopMenu></TopMenu>
@ -18,10 +22,14 @@
import TopMenu from './top-menu/index.vue' import TopMenu from './top-menu/index.vue'
import Avatar from './avatar/index.vue' import Avatar from './avatar/index.vue'
import TopAbout from './top-about/index.vue' import TopAbout from './top-about/index.vue'
import Workspace from './workspace/index.vue' import { EditionConst } from '@/utils/permission/data'
import { useRouter } from 'vue-router' import { hasPermission } from '@/utils/permission/index'
import WorkspaceDropdown from './workspace-dropdown/index.vue'
import { useRouter } from 'vue-router'
import useStore from '@/stores'
const router = useRouter() const router = useRouter()
const { user } = useStore()
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.app-top-bar-container { .app-top-bar-container {

View File

@ -45,7 +45,7 @@ async function getWorkspaceList() {
} }
onBeforeMount(async () => { onBeforeMount(async () => {
// await getWorkspaceList() await getWorkspaceList()
const id = localStorage.getItem('workspace_id') ?? 'default' const id = localStorage.getItem('workspace_id') ?? 'default'
currentWorkspace.value = workspaceList.value.find(item => item.id === id) currentWorkspace.value = workspaceList.value.find(item => item.id === id)
}) })

View File

@ -77,7 +77,7 @@ const useUserStore = defineStore('user', {
this.edition = ok.data.edition this.edition = ok.data.edition
if (this.isEE() || this.isPE()) { if (this.isEE() || this.isPE()) {
// await this.theme() await this.theme()
} else { } else {
this.themeInfo = { this.themeInfo = {
...defaultPlatformSetting, ...defaultPlatformSetting,