22 <el-dropdown trigger =" click" type =" primary" >
33 <div class =" flex-center cursor" >
44 <el-avatar :size =" 30" >
5- <img src =" @/assets/user-icon.svg" style =" width : 54% " alt =" " />
5+ <img src =" @/assets/user-icon.svg" style =" width : 54% " alt =" " />
66 </el-avatar >
77 <span class =" ml-8 color-text-primary" >{{ user.userInfo?.username }}</span >
88 <el-icon class =" el-icon--right" >
9- <CaretBottom />
9+ <CaretBottom />
1010 </el-icon >
1111 </div >
1212
1515 <div class =" userInfo flex align-center" >
1616 <div class =" mr-12 flex align-center" >
1717 <el-avatar :size =" 30" >
18- <img src =" @/assets/user-icon.svg" style =" width : 54% " alt =" " />
18+ <img src =" @/assets/user-icon.svg" style =" width : 54% " alt =" " />
1919 </el-avatar >
2020 </div >
2121 <div style =" width : 90% " >
2222 <p class =" bold mb-4" style =" font-size : 14px " >{{ user.userInfo?.username }}</p >
2323 <template v-if =" user .userInfo ?.role && user .userInfo .role .length > 0 " >
2424 <el-tag size =" small" class =" default-tag" >{{ user.userInfo?.role[0] }}</el-tag >
2525 <el-tag size =" small" class =" default-tag ml-4" v-if =" user.userInfo?.role?.length > 1"
26- >+{{ user.userInfo?.role?.length - 1 }}
26+ >+{{ user.userInfo?.role?.length - 1 }}
2727 </el-tag >
2828 </template >
2929 </div >
3030 </div >
3131 <el-dropdown-item class =" border-t p-8" @click =" openResetPassword" >
3232 {{ $t('views.login.resetPassword') }}
3333 </el-dropdown-item >
34- <div v-hasPermission =" new ComplexPermission([], ['x-pack'], 'OR')" >
34+ <div
35+ v-hasPermission ="
36+ new ComplexPermission([], [], [EditionConst.IS_EE, EditionConst.IS_PE], 'OR')
37+ "
38+ >
3539 <el-dropdown-item class =" p-8" @click =" openAPIKeyDialog" >
3640 {{ $t('layout.apiKey') }}
3741 </el-dropdown-item >
4145 <div class =" flex-between w-full" style =" line-height : 22px ; padding : 12px 11px " >
4246 <span > {{ $t('layout.language') }}</span >
4347 <el-icon >
44- <ArrowRight />
48+ <ArrowRight />
4549 </el-icon >
4650 </div >
4751
5559 class =" flex-between"
5660 >
5761 <span :class =" lang.value === user.userInfo?.language ? 'primary' : ''" >{{
58- lang.label
59- }}</span >
62+ lang.label
63+ }}</span >
6064
6165 <el-icon
6266 :class =" lang.value === user.userInfo?.language ? 'primary' : ''"
6367 v-if =" lang.value === user.userInfo?.language"
6468 >
65- <Check />
69+ <Check />
6670 </el-icon >
6771 </el-dropdown-item >
6872 </el-dropdown-menu >
8690 </el-dropdown-menu >
8791 </template >
8892 </el-dropdown >
89- <APIKeyDialog :user-id =" user.userInfo?.id" ref =" APIKeyDialogRef" />
93+ <APIKeyDialog :user-id =" user.userInfo?.id" ref =" APIKeyDialogRef" />
9094 <ResetPassword ref =" resetPasswordRef" ></ResetPassword >
9195 <AboutDialog ref =" AboutDialogRef" ></AboutDialog >
9296
9397 <!-- <UserPwdDialog ref="UserPwdDialogRef" /> -->
9498</template >
9599<script setup lang="ts">
96- import {ref , onMounted } from ' vue'
100+ import { ref , onMounted } from ' vue'
97101import useStore from ' @/stores'
98- import {useRouter } from ' vue-router'
102+ import { useRouter } from ' vue-router'
99103import ResetPassword from ' ./ResetPassword.vue'
100104import AboutDialog from ' ./AboutDialog.vue'
101105// import UserPwdDialog from '@/views/user-manage/component/UserPwdDialog.vue'
102106import APIKeyDialog from ' ./APIKeyDialog.vue'
103- import {ComplexPermission } from ' @/utils/permission/type'
104- import {langList } from ' @/locales/index'
107+ import { ComplexPermission } from ' @/utils/permission/type'
108+ import { langList } from ' @/locales/index'
109+ import { EditionConst } from ' @/utils/permission/data'
105110
106- const {user, login} = useStore ()
111+ const { user, login } = useStore ()
107112const router = useRouter ()
108113
109114const AboutDialogRef = ref ()
@@ -129,7 +134,7 @@ const openResetPassword = () => {
129134
130135const logout = () => {
131136 login .logout ().then (() => {
132- router .push ({name: ' login' })
137+ router .push ({ name: ' login' })
133138 })
134139}
135140
0 commit comments