add i18n
This commit is contained in:
+15
-14
@@ -1,26 +1,26 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card title="个人信息">
|
||||
<el-card :title="T('Userinfo')">
|
||||
<el-form class="info-form" ref="form" label-width="120px" label-suffix=":">
|
||||
<el-form-item label="用户名">
|
||||
<el-form-item :label="T('Username')">
|
||||
<div>{{ userStore.username }}</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-button type="danger" @click="showChangePwd">修改密码</el-button>
|
||||
<el-form-item :label="T('Password')" prop="password">
|
||||
<el-button type="danger" @click="showChangePwd">{{ T('ChangePassword') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="OIDC">
|
||||
<el-table :data="oidcData" border fit>
|
||||
<el-table-column label="平台" prop="third_type" align="center"></el-table-column>
|
||||
<el-table-column label="状态" prop="status" align="center">
|
||||
<el-table-column :label="T('Platform')" prop="third_type" align="center"></el-table-column>
|
||||
<el-table-column :label="T('Status')" prop="status" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.status === 1" type="success">已绑定</el-tag>
|
||||
<el-tag v-else type="danger">未绑定</el-tag>
|
||||
<el-tag v-if="row.status === 1" type="success">{{ T('HasBind') }}</el-tag>
|
||||
<el-tag v-else type="danger">{{ T('NoBind') }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="200">
|
||||
<el-table-column :label="T('Actions')" align="center" width="200">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.status === 1" type="danger" size="small" @click="toUnBind(row)">解除绑定</el-button>
|
||||
<el-button v-else type="success" size="small" @click="toBind(row)">去绑定</el-button>
|
||||
<el-button v-if="row.status === 1" type="danger" size="small" @click="toUnBind(row)">{{ T('UnBind') }}</el-button>
|
||||
<el-button v-else type="success" size="small" @click="toBind(row)">{{ T('ToBind') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -38,6 +38,7 @@
|
||||
import { bind, unbind } from '@/api/oauth'
|
||||
import { myOauth } from '@/api/user'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { T } from '@/utils/i18n'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const changePwdVisible = ref(false)
|
||||
@@ -61,9 +62,9 @@
|
||||
}
|
||||
}
|
||||
const toUnBind = async (row) => {
|
||||
const cf = await ElMessageBox.confirm('确定解除绑定么?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
const cf = await ElMessageBox.confirm(T('Confirm?', { param: T('UnBind') }), {
|
||||
confirmButtonText: T('Confirm'),
|
||||
cancelButtonText: T('Cancel'),
|
||||
type: 'warning',
|
||||
}).catch(_ => false)
|
||||
if (!cf) {
|
||||
|
||||
Reference in New Issue
Block a user