Skip to content

Commit 4e376d2

Browse files
author
Kerwin
committed
fix: ui display problem(Close #357, #358)
1 parent c595e19 commit 4e376d2

File tree

8 files changed

+93
-19
lines changed

8 files changed

+93
-19
lines changed

README.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Introduction
1010
> **This project is forked from [Chanzhaoyu/chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web), some unique features have been added:**
1111
12-
[] Register & Login & Reset Password
12+
[] Register & Login & Reset Password & 2FA
1313

1414
[] Sync chat history
1515

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## 说明
1010
> **此项目 Fork 自 [Chanzhaoyu/chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web), 新增了部分特色功能:**
1111
12-
[] 注册&登录&重置密码
12+
[] 注册 & 登录 & 重置密码 & 2FA
1313

1414
[] 同步历史会话
1515

src/components/common/Setting/TwoFA.vue

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ onMounted(() => {
6565
<div class="space-y-6">
6666
<div class="flex items-center space-x-4">
6767
<div class="flex-1">
68-
两步验证是一个额外的验证步骤,可让您的登录体验更加安全。开启两步验证后,每次您要登录到您的帐户时,系统均提示您输入动态验证码。
69-
<br> 当前状态
70-
<span v-if="!config || !config.enaled" style="color: red;">关闭</span>
71-
<span v-if="config && config.enaled" style="color: rgb(22, 183, 65);">已开启</span>
68+
{{ $t('setting.info2FA') }}
69+
<br> {{ $t('setting.status2FA') }}
70+
<span v-if="!config || !config.enaled" style="color: red;">{{ $t('setting.status2FAClosed') }}</span>
71+
<span v-if="config && config.enaled" style="color: rgb(22, 183, 65);">{{ $t('setting.status2FAOpened') }}</span>
7272
</div>
7373
</div>
7474
<div v-if="config && config.enaled" class="flex items-center space-x-4">
@@ -94,21 +94,21 @@ onMounted(() => {
9494
<div class="flex-1">
9595
<NSteps vertical>
9696
<NStep
97-
title="安装身份验证器App"
98-
description="安装身份验证器App,例如Google Authenticator、Microsoft Authenticator、Authy等"
97+
:title="$t('setting.info2FAStep1')"
98+
:description="$t('setting.info2FAStep1Desc')"
9999
/>
100100
<NStep
101-
title="配置生成验证码"
101+
:title="$t('setting.info2FAStep2')"
102102
>
103-
打开身份验证器 App,点击「扫描二维码」扫描二维码。
103+
{{ $t('setting.info2FAStep2Desc') }}
104104
<br><br>
105105
<QrcodeVue :value="config?.otpauthUrl" :size="150" level="H" />
106-
<br>注意: 身份验证器不能扫描验证码? 手动添加以下账户:<br> 账户 :{{ config?.userName }}<br> 密钥 :{{ config?.secretKey }}
106+
<br>{{ $t('setting.info2FAStep2Tip') }}:<br> {{ $t('setting.info2FAStep2TipAccount') }} :{{ config?.userName }}<br> {{ $t('setting.info2FAStep2TipSecret') }} :{{ config?.secretKey }}
107107
</NStep>
108108
<NStep
109-
title="验证并开启"
109+
:title="$t('setting.info2FAStep3')"
110110
>
111-
请输入身份验证器 App 生成的 6 位动态验证码,开启两步验证。
111+
{{ $t('setting.info2FAStep3Desc') }}
112112
<br>
113113
<div class="flex items-center space-x-4">
114114
<div class="w-[200px]">
@@ -125,7 +125,9 @@ onMounted(() => {
125125
</NButton>
126126
</div>
127127
</div>
128-
<br>注意:如何关闭两步验证?<br>1. 登录后,在 两步验证 页面使用两步验证码关闭。<br>2. 联系管理员重置密码来关闭两步验证。
128+
<br>{{ $t('setting.info2FAStep3Tip1') }}
129+
<br>{{ $t('setting.info2FAStep3Tip2') }}
130+
<br>{{ $t('setting.info2FAStep3Tip3') }}
129131
</NStep>
130132
</NSteps>
131133
</div>

src/components/common/Setting/User.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ const columns = [
2727
{
2828
title: 'Register Time',
2929
key: 'createTime',
30-
width: 220,
30+
width: 200,
3131
},
3232
{
3333
title: 'Verify Time',
3434
key: 'verifyTime',
35-
width: 220,
35+
width: 200,
3636
},
3737
{
3838
title: 'Roles',
@@ -60,7 +60,7 @@ const columns = [
6060
{
6161
title: 'Status',
6262
key: 'status',
63-
width: 200,
63+
width: 80,
6464
render(row: any) {
6565
return Status[row.status]
6666
},
@@ -188,8 +188,8 @@ async function handleUpdateUserStatus(userId: string, status: Status) {
188188
189189
async function handleDisable2FA(userId: string) {
190190
dialog.warning({
191-
title: t('chat.deleteUser'),
192-
content: t('chat.deleteUserConfirm'),
191+
title: t('chat.disable2FA'),
192+
content: t('chat.disable2FAConfirm'),
193193
positiveText: t('common.yes'),
194194
negativeText: t('common.no'),
195195
onPositiveClick: async () => {

src/locales/en-US.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export default {
7171
deleteKey: 'Delete Key',
7272
editKeyButton: 'Edit Key',
7373
deleteKeyConfirm: 'Are you sure to delete this key?',
74+
disable2FA: 'Disable 2FA',
75+
disable2FAConfirm: 'Are you sure to disable 2FA for this user?',
7476
},
7577
setting: {
7678
setting: 'Setting',
@@ -149,6 +151,22 @@ export default {
149151
twoFAConfig: '2FA',
150152
disable2FA: 'Disable 2FA',
151153
enable2FA: 'Enable 2FA',
154+
info2FA: 'Two-step verification is an additional authentication step that enhances the security of your login experience. After enabling two-step verification, every time you log in to your account, the system will prompt you to enter a dynamic verification code.',
155+
status2FA: 'Current status',
156+
status2FAClosed: 'Closed',
157+
status2FAOpened: 'Opened',
158+
info2FAStep1: 'Install the Authenticator App',
159+
info2FAStep1Desc: 'Install the authentication app, for example: Google Authenticator、Microsoft Authenticator、Authy',
160+
info2FAStep2: 'Generate verification code for configuration.',
161+
info2FAStep2Desc: 'Open the Authenticator App and click "Scan QR Code" to scan the QR code.',
162+
info2FAStep2Tip: 'Note: The authenticator cannot scan the verification code? Please manually add the following account.',
163+
info2FAStep2TipAccount: 'Account',
164+
info2FAStep2TipSecret: 'Secret',
165+
info2FAStep3: 'Verify and enable',
166+
info2FAStep3Desc: 'Please enter the 6-digit dynamic verification code generated by the authentication app to enable two-step verification.',
167+
info2FAStep3Tip1: 'Note: How to turn off two-step verification?',
168+
info2FAStep3Tip2: '1. After logging in, use the two-step verification on the Two-Step Verification page to disable it.',
169+
info2FAStep3Tip3: '2. Contact the administrator to disable two-step verification.',
152170
},
153171
store: {
154172
siderButton: 'Prompt Store',

src/locales/ko-KR.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export default {
7171
deleteKey: 'Delete Key',
7272
editKeyButton: 'Edit Key',
7373
deleteKeyConfirm: 'Are you sure to delete this key?',
74+
disable2FA: 'Disable 2FA',
75+
disable2FAConfirm: 'Are you sure to disable 2FA for this user?',
7476
},
7577
setting: {
7678
setting: '설정',
@@ -147,6 +149,22 @@ export default {
147149
twoFAConfig: '2FA',
148150
disable2FA: 'Disable 2FA',
149151
enable2FA: 'Enable 2FA',
152+
info2FA: 'Two-step verification is an additional authentication step that enhances the security of your login experience. After enabling two-step verification, every time you log in to your account, the system will prompt you to enter a dynamic verification code.',
153+
status2FA: 'Current status',
154+
status2FAClosed: 'Closed',
155+
status2FAOpened: 'Opened',
156+
info2FAStep1: 'Install the Authenticator App',
157+
info2FAStep1Desc: 'Install the authentication app, for example: Google Authenticator、Microsoft Authenticator、Authy',
158+
info2FAStep2: 'Generate verification code for configuration.',
159+
info2FAStep2Desc: 'Open the Authenticator App and click "Scan QR Code" to scan the QR code.',
160+
info2FAStep2Tip: 'Note: The authenticator cannot scan the verification code? Please manually add the following account.',
161+
info2FAStep2TipAccount: 'Account',
162+
info2FAStep2TipSecret: 'Secret',
163+
info2FAStep3: 'Verify and enable',
164+
info2FAStep3Desc: 'Please enter the 6-digit dynamic verification code generated by the authentication app to enable two-step verification.',
165+
info2FAStep3Tip1: 'Note: How to turn off two-step verification?',
166+
info2FAStep3Tip2: '1. After logging in, use the two-step verification on the Two-Step Verification page to disable it.',
167+
info2FAStep3Tip3: '2. Contact the administrator to disable two-step verification.',
150168
},
151169
store: {
152170
siderButton: '프롬프트 스토어',

src/locales/zh-CN.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export default {
7171
deleteKey: '删除 Key',
7272
editKeyButton: '编辑 Key',
7373
deleteKeyConfirm: '你确定要删除这个 key 吗?',
74+
disable2FA: '禁用 2FA',
75+
disable2FAConfirm: '您确定要为此用户禁用两步验证吗??',
7476
},
7577
setting: {
7678
setting: '设置',
@@ -149,6 +151,22 @@ export default {
149151
twoFAConfig: '两步验证',
150152
disable2FA: '禁用 2FA',
151153
enable2FA: '开启 2FA',
154+
info2FA: '两步验证是一个额外的验证步骤,可让您的登录体验更加安全。开启两步验证后,每次您要登录到您的帐户时,系统均提示您输入动态验证码。',
155+
status2FA: '当前状态',
156+
status2FAClosed: '关闭',
157+
status2FAOpened: '已开启',
158+
info2FAStep1: '安装身份验证器App',
159+
info2FAStep1Desc: '安装身份验证器App,例如Google Authenticator、Microsoft Authenticator、Authy等',
160+
info2FAStep2: '配置生成验证码',
161+
info2FAStep2Desc: '打开身份验证器 App,点击「扫描二维码」扫描二维码。',
162+
info2FAStep2Tip: '注意: 身份验证器不能扫描验证码? 手动添加以下账户',
163+
info2FAStep2TipAccount: '账户',
164+
info2FAStep2TipSecret: '密钥',
165+
info2FAStep3: '验证并开启',
166+
info2FAStep3Desc: '请输入身份验证器 App 生成的 6 位动态验证码,开启两步验证。',
167+
info2FAStep3Tip1: '注意:如何关闭两步验证?',
168+
info2FAStep3Tip2: '1. 登录后,在 两步验证 页面使用两步验证码关闭。',
169+
info2FAStep3Tip3: '2. 联系管理员来关闭两步验证。',
152170
},
153171
store: {
154172
siderButton: '提示词商店',

src/locales/zh-TW.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export default {
7171
deleteKey: '刪除 Key',
7272
editKeyButton: '編輯 Key',
7373
deleteKeyConfirm: '你確定要刪除這個 key 嗎?',
74+
disable2FA: '禁用 2FA',
75+
disable2FAConfirm: '您确定要为此用户禁用两步验证吗??',
7476
},
7577
setting: {
7678
setting: '設定',
@@ -149,6 +151,22 @@ export default {
149151
twoFAConfig: '两步验证',
150152
disable2FA: '禁用 2FA',
151153
enable2FA: '开启 2FA',
154+
info2FA: '两步验证是一个额外的验证步骤,可让您的登录体验更加安全。开启两步验证后,每次您要登录到您的帐户时,系统均提示您输入动态验证码。',
155+
status2FA: '当前状态',
156+
status2FAClosed: '关闭',
157+
status2FAOpened: '已开启',
158+
info2FAStep1: '安装身份验证器App',
159+
info2FAStep1Desc: '安装身份验证器App,例如Google Authenticator、Microsoft Authenticator、Authy等',
160+
info2FAStep2: '配置生成验证码',
161+
info2FAStep2Desc: '打开身份验证器 App,点击「扫描二维码」扫描二维码。',
162+
info2FAStep2Tip: '注意: 身份验证器不能扫描验证码? 手动添加以下账户',
163+
info2FAStep2TipAccount: '账户',
164+
info2FAStep2TipSecret: '密钥',
165+
info2FAStep3: '验证并开启',
166+
info2FAStep3Desc: '请输入身份验证器 App 生成的 6 位动态验证码,开启两步验证。',
167+
info2FAStep3Tip1: '注意:如何关闭两步验证?',
168+
info2FAStep3Tip2: '1. 登录后,在 两步验证 页面使用两步验证码关闭。',
169+
info2FAStep3Tip3: '2. 联系管理员来关闭两步验证。',
152170
},
153171
store: {
154172
siderButton: '提示詞商店',

0 commit comments

Comments
 (0)