fix: i18n
parent
e8a52c824a
commit
0b72c5d4c2
|
|
@ -23,7 +23,7 @@
|
||||||
<template v-if="user.userInfo?.role_name && user.userInfo.role_name.length > 0">
|
<template v-if="user.userInfo?.role_name && user.userInfo.role_name.length > 0">
|
||||||
<TagGroup
|
<TagGroup
|
||||||
size="small"
|
size="small"
|
||||||
:tags="user.userInfo?.role_name"
|
:tags="role_list"
|
||||||
v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')"
|
v-if="hasPermission([EditionConst.IS_EE, EditionConst.IS_PE], 'OR')"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -150,9 +150,10 @@
|
||||||
<!-- <UserPwdDialog ref="UserPwdDialogRef" /> -->
|
<!-- <UserPwdDialog ref="UserPwdDialogRef" /> -->
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {ref, onMounted} from 'vue'
|
import {ref, onMounted, computed} from 'vue'
|
||||||
import useStore from '@/stores'
|
import useStore from '@/stores'
|
||||||
import {useRouter} from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
import {t} from "@/locales"
|
||||||
import ResetPassword from './ResetPassword.vue'
|
import ResetPassword from './ResetPassword.vue'
|
||||||
import AboutDialog from './AboutDialog.vue'
|
import AboutDialog from './AboutDialog.vue'
|
||||||
// import UserPwdDialog from '@/views/user-manage/component/UserPwdDialog.vue'
|
// import UserPwdDialog from '@/views/user-manage/component/UserPwdDialog.vue'
|
||||||
|
|
@ -185,7 +186,23 @@ function openAPIKeyDialog() {
|
||||||
const openResetPassword = () => {
|
const openResetPassword = () => {
|
||||||
resetPasswordRef.value?.open()
|
resetPasswordRef.value?.open()
|
||||||
}
|
}
|
||||||
|
const m:any = {
|
||||||
|
"系统管理员": 'layout.about.inner_admin',
|
||||||
|
"工作空间管理员": 'layout.about.inner_wsm',
|
||||||
|
"普通用户":'layout.about.inner_user'
|
||||||
|
}
|
||||||
|
const role_list = computed(() => {
|
||||||
|
if (!user.userInfo) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return user.userInfo?.role_name?.map(name => {
|
||||||
|
const inner = m[name]
|
||||||
|
if (inner) {
|
||||||
|
return t(inner)
|
||||||
|
}
|
||||||
|
return name
|
||||||
|
})
|
||||||
|
})
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
login.logout().then(() => {
|
login.logout().then(() => {
|
||||||
if (user?.userInfo?.source && ['CAS', 'OIDC', 'OAuth2'].includes(user.userInfo.source)) {
|
if (user?.userInfo?.source && ['CAS', 'OIDC', 'OAuth2'].includes(user.userInfo.source)) {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,9 @@ export default {
|
||||||
remark: 'Remarks',
|
remark: 'Remarks',
|
||||||
update: 'Update',
|
update: 'Update',
|
||||||
authorize: 'Authorized',
|
authorize: 'Authorized',
|
||||||
|
inner_admin: 'System Admin',
|
||||||
|
inner_wsm: 'Workspace Manager',
|
||||||
|
inner_user: 'Common User',
|
||||||
},
|
},
|
||||||
time: {
|
time: {
|
||||||
daysLater: 'days later',
|
daysLater: 'days later',
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,11 @@ export default {
|
||||||
serialNo: '序列号',
|
serialNo: '序列号',
|
||||||
remark: '备注',
|
remark: '备注',
|
||||||
update: '更新',
|
update: '更新',
|
||||||
authorize: '授权给'
|
authorize: '授权给',
|
||||||
|
inner_admin: '系统管理员',
|
||||||
|
inner_wsm: '工作空间管理员',
|
||||||
|
inner_user: '普通用户',
|
||||||
|
|
||||||
},
|
},
|
||||||
time: {
|
time: {
|
||||||
daysLater: '天后',
|
daysLater: '天后',
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,10 @@ export default {
|
||||||
serialNo: '序列號',
|
serialNo: '序列號',
|
||||||
remark: '備註',
|
remark: '備註',
|
||||||
update: '更新',
|
update: '更新',
|
||||||
authorize: '授權給'
|
authorize: '授權給',
|
||||||
|
inner_admin: '系統管理員',
|
||||||
|
inner_wsm: '工作空間管理員',
|
||||||
|
inner_user: '普通用戶',
|
||||||
},
|
},
|
||||||
time: {
|
time: {
|
||||||
daysLater: '天後',
|
daysLater: '天後',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue