Skip to content

Commit 310fd12

Browse files
feat: Permission
1 parent 1b5d0f7 commit 310fd12

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

ui/src/layout/layout-header/UserHeader.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
<div class="logo mt-4">
55
<LogoFull />
66
</div>
7-
<el-divider direction="vertical" class="ml-24 mr-24" />
8-
<Workspace />
7+
<el-divider
8+
direction="vertical"
9+
class="ml-24 mr-24"
10+
v-if="hasPermission(EditionConst.IS_EE, 'OR')"
11+
/>
12+
<WorkspaceDropdown v-if="hasPermission(EditionConst.IS_EE, 'OR')" />
913
<div class="flex-between w-full">
1014
<div></div>
1115
<TopMenu></TopMenu>
@@ -18,10 +22,14 @@
1822
import TopMenu from './top-menu/index.vue'
1923
import Avatar from './avatar/index.vue'
2024
import TopAbout from './top-about/index.vue'
21-
import Workspace from './workspace/index.vue'
22-
import { useRouter } from 'vue-router'
25+
import { EditionConst } from '@/utils/permission/data'
26+
import { hasPermission } from '@/utils/permission/index'
27+
import WorkspaceDropdown from './workspace-dropdown/index.vue'
2328
29+
import { useRouter } from 'vue-router'
30+
import useStore from '@/stores'
2431
const router = useRouter()
32+
const { user } = useStore()
2533
</script>
2634
<style lang="scss" scoped>
2735
.app-top-bar-container {

ui/src/layout/layout-header/workspace/index.vue renamed to ui/src/layout/layout-header/workspace-dropdown/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function getWorkspaceList() {
4545
}
4646
4747
onBeforeMount(async () => {
48-
// await getWorkspaceList()
48+
await getWorkspaceList()
4949
const id = localStorage.getItem('workspace_id') ?? 'default'
5050
currentWorkspace.value = workspaceList.value.find(item => item.id === id)
5151
})

ui/src/stores/modules/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const useUserStore = defineStore('user', {
7777
this.edition = ok.data.edition
7878

7979
if (this.isEE() || this.isPE()) {
80-
// await this.theme()
80+
await this.theme()
8181
} else {
8282
this.themeInfo = {
8383
...defaultPlatformSetting,

0 commit comments

Comments
 (0)