|
23 | 23 | <template v-if="user.userInfo?.role_name && user.userInfo.role_name.length > 0"> |
24 | 24 | <TagGroup |
25 | 25 | size="small" |
26 | | - :tags="user.userInfo?.role_name" |
| 26 | + :tags="role_list" |
27 | 27 | v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')" |
28 | 28 | /> |
29 | 29 | </template> |
|
150 | 150 | <!-- <UserPwdDialog ref="UserPwdDialogRef" /> --> |
151 | 151 | </template> |
152 | 152 | <script setup lang="ts"> |
153 | | -import {ref, onMounted} from 'vue' |
| 153 | +import {ref, onMounted, computed} from 'vue' |
154 | 154 | import useStore from '@/stores' |
155 | | -import {useRouter} from 'vue-router' |
| 155 | +import { useRouter } from 'vue-router' |
| 156 | +import {t} from "@/locales" |
156 | 157 | import ResetPassword from './ResetPassword.vue' |
157 | 158 | import AboutDialog from './AboutDialog.vue' |
158 | 159 | // import UserPwdDialog from '@/views/user-manage/component/UserPwdDialog.vue' |
@@ -185,7 +186,23 @@ function openAPIKeyDialog() { |
185 | 186 | const openResetPassword = () => { |
186 | 187 | resetPasswordRef.value?.open() |
187 | 188 | } |
188 | | -
|
| 189 | +const m:any = { |
| 190 | + "系统管理员": 'layout.about.inner_admin', |
| 191 | + "工作空间管理员": 'layout.about.inner_wsm', |
| 192 | + "普通用户":'layout.about.inner_user' |
| 193 | +} |
| 194 | +const role_list = computed(() => { |
| 195 | + if (!user.userInfo) { |
| 196 | +return [] |
| 197 | + } |
| 198 | + return user.userInfo?.role_name?.map(name => { |
| 199 | + const inner = m[name] |
| 200 | + if (inner) { |
| 201 | + return t(inner) |
| 202 | + } |
| 203 | + return name |
| 204 | + }) |
| 205 | +}) |
189 | 206 | const logout = () => { |
190 | 207 | login.logout().then(() => { |
191 | 208 | if (user?.userInfo?.source && ['CAS', 'OIDC', 'OAuth2'].includes(user.userInfo.source)) { |
|
0 commit comments