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 ellipsis"
88 :title="user.userInfo?.nick_name">{{ user.userInfo?.nick_name }}</span>
1616 <div class =" userInfo flex align-center" >
1717 <div class =" mr-12 flex align-center" >
1818 <el-avatar :size =" 30" >
19- <img src =" @/assets/user-icon.svg" style =" width : 54% " alt =" " />
19+ <img src =" @/assets/user-icon.svg" style =" width : 54% " alt =" " />
2020 </el-avatar >
2121 </div >
2222 <div style =" width : 90% " >
23- <p class =" bold mb-4" style =" font-size : 14px " >{{ user.userInfo?.nick_name }} <span
24- class =" color-secondary lighter" >({{ user.userInfo?.username }})</span ></p >
23+ <p class =" bold mb-4" style =" font-size : 14px " >
24+ {{ i18n_name(user.userInfo?.nick_name as string) }}
25+ <span class =" color-secondary lighter" >({{ user.userInfo?.username }})</span >
26+ </p >
2527 <template v-if =" user .userInfo ?.role_name && user .userInfo .role_name .length > 0 " >
2628 <TagGroup
2729 size =" small"
7375 v-if ="
7476 hasPermission(
7577 new ComplexPermission(
76- [RoleConst.ADMIN,RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER],
78+ [RoleConst.ADMIN, RoleConst.ADMIN, RoleConst.WORKSPACE_MANAGE, RoleConst.USER],
7779 [PermissionConst.SYSTEM_API_KEY_EDIT],
7880 [EditionConst.IS_EE, EditionConst.IS_PE],
7981 'OR',
104106 <div class =" flex-between w-full" style =" line-height : 22px ; padding : 12px 11px " >
105107 <span > {{ $t('layout.language') }}</span >
106108 <el-icon >
107- <ArrowRight />
109+ <ArrowRight />
108110 </el-icon >
109111 </div >
110112
118120 class =" flex-between"
119121 >
120122 <span :class =" lang.value === user.userInfo?.language ? 'primary' : ''" >{{
121- lang.label
122- }}</span >
123+ lang.label
124+ }}</span >
123125
124126 <el-icon
125127 :class =" lang.value === user.userInfo?.language ? 'primary' : ''"
126128 v-if =" lang.value === user.userInfo?.language"
127129 >
128- <Check />
130+ <Check />
129131 </el-icon >
130132 </el-dropdown-item >
131133 </el-dropdown-menu >
135137 <el-dropdown-item
136138 @click =" openAbout"
137139 v-if ="
138- hasPermission(
139- new ComplexPermission(
140- [RoleConst.ADMIN, RoleConst.USER, RoleConst.WORKSPACE_MANAGE],
141- [PermissionConst.ABOUT_READ],
142- [],
143- 'OR',
144- ),
140+ hasPermission(
141+ new ComplexPermission(
142+ [RoleConst.ADMIN, RoleConst.USER, RoleConst.WORKSPACE_MANAGE],
143+ [PermissionConst.ABOUT_READ],
144+ [],
145145 'OR',
146- )
147- "
146+ ),
147+ 'OR',
148+ )
149+ "
148150 >
149151 {{ $t('layout.about.title') }}
150152 </el-dropdown-item >
155157 </el-dropdown-menu >
156158 </template >
157159 </el-dropdown >
158- <APIKeyDialog :user-id =" user.userInfo?.id" ref =" APIKeyDialogRef" />
160+ <APIKeyDialog :user-id =" user.userInfo?.id" ref =" APIKeyDialogRef" />
159161 <ResetPassword ref =" resetPasswordRef" ></ResetPassword >
160162 <AboutDialog ref =" AboutDialogRef" ></AboutDialog >
161163
162164 <!-- <UserPwdDialog ref="UserPwdDialogRef" /> -->
163165</template >
164166<script setup lang="ts">
165- import {ref , onMounted , computed } from ' vue'
167+ import { ref , onMounted , computed } from ' vue'
166168import useStore from ' @/stores'
167- import {useRouter } from ' vue-router'
168- import {t } from " @/locales"
169+ import { useRouter } from ' vue-router'
170+ import { t } from ' @/locales'
169171import ResetPassword from ' ./ResetPassword.vue'
170172import AboutDialog from ' ./AboutDialog.vue'
171173// import UserPwdDialog from '@/views/user-manage/component/UserPwdDialog.vue'
172174import APIKeyDialog from ' ./APIKeyDialog.vue'
173- import {ComplexPermission } from ' @/utils/permission/type'
174- import {langList } from ' @/locales/index'
175- import {hasPermission } from ' @/utils/permission'
176- import {PermissionConst , RoleConst , EditionConst } from ' @/utils/permission/data'
175+ import { ComplexPermission } from ' @/utils/permission/type'
176+ import { langList } from ' @/locales/index'
177+ import { hasPermission } from ' @/utils/permission'
178+ import { PermissionConst , RoleConst , EditionConst } from ' @/utils/permission/data'
179+ import { i18n_name } from ' @/utils/common'
177180
178- const {user, login} = useStore ()
181+ const { user, login } = useStore ()
179182const router = useRouter ()
180183
181184const AboutDialogRef = ref ()
@@ -199,15 +202,15 @@ const openResetPassword = () => {
199202 resetPasswordRef .value ?.open ()
200203}
201204const m: any = {
202- " 系统管理员" : ' layout.about.inner_admin' ,
203- " 工作空间管理员" : ' layout.about.inner_wsm' ,
204- " 普通用户" : ' layout.about.inner_user'
205+ 系统管理员: ' layout.about.inner_admin' ,
206+ 工作空间管理员: ' layout.about.inner_wsm' ,
207+ 普通用户: ' layout.about.inner_user' ,
205208}
206209const role_list = computed (() => {
207210 if (! user .userInfo ) {
208211 return []
209212 }
210- return user .userInfo ?.role_name ?.map (name => {
213+ return user .userInfo ?.role_name ?.map (( name ) => {
211214 const inner = m [name ]
212215 if (inner ) {
213216 return t (inner )
@@ -218,9 +221,9 @@ const role_list = computed(() => {
218221const logout = () => {
219222 login .logout ().then (() => {
220223 if (user ?.userInfo ?.source && [' CAS' , ' OIDC' , ' OAuth2' ].includes (user .userInfo .source )) {
221- router .push ({name: ' login' , query: {login_mode: ' manual' } })
224+ router .push ({ name: ' login' , query: { login_mode: ' manual' } })
222225 } else {
223- router .push ({name: ' login' })
226+ router .push ({ name: ' login' })
224227 }
225228 })
226229}
0 commit comments