From 85bd9aa745715cb26a9ceaa0a461b6a5709c9c0c Mon Sep 17 00:00:00 2001 From: dataeaseShu Date: Wed, 30 Jul 2025 10:45:31 +0800 Subject: [PATCH] fix: bug fix --- frontend/src/components/layout/Person.vue | 4 +++- frontend/src/i18n/en.json | 4 +++- frontend/src/i18n/zh-CN.json | 2 ++ frontend/src/views/chat/ChatList.vue | 15 +++++++++------ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/layout/Person.vue b/frontend/src/components/layout/Person.vue index 57f11ae1..19c7ca24 100644 --- a/frontend/src/components/layout/Person.vue +++ b/frontend/src/components/layout/Person.vue @@ -52,7 +52,9 @@ const changeLanguage = (lang: string) => { const param = { language: lang, } - userApi.language(param) + userApi.language(param).then(() => { + window.location.reload() + }) } const openPwd = () => { diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index cdb426ab..7a27e4c2 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -6,6 +6,8 @@ "AI Model Configuration": "AI Model Configuration" }, "common": { + "proceed_with_caution": "Deletion is irreversible, so proceed with caution.", + "sales_in_2024": "Delete conversation: {msg}?", "limited_to_30": "The number of data tables is limited to 30", "enter_your_password": "Please enter your password", "your_account_email_address": "Please enter your account/email address", @@ -521,4 +523,4 @@ "back_community": "Restore to Community Edition", "confirm_tips": "Are you sure to restore to Community Edition?" } -} +} \ No newline at end of file diff --git a/frontend/src/i18n/zh-CN.json b/frontend/src/i18n/zh-CN.json index 62bd7a8c..750e9e8a 100644 --- a/frontend/src/i18n/zh-CN.json +++ b/frontend/src/i18n/zh-CN.json @@ -6,6 +6,8 @@ "AI Model Configuration": "模型配置" }, "common": { + "proceed_with_caution": "删除后无法恢复,请谨慎操作。", + "sales_in_2024": "是否删除对话:{msg}?", "limited_to_30": "数据表数量限制30", "enter_your_password": "请输入密码", "your_account_email_address": "请输入账号/邮箱", diff --git a/frontend/src/views/chat/ChatList.vue b/frontend/src/views/chat/ChatList.vue index d81353b2..97273335 100644 --- a/frontend/src/views/chat/ChatList.vue +++ b/frontend/src/views/chat/ChatList.vue @@ -112,18 +112,21 @@ function handleCommand(command: string | number | object, chat: Chat) { dialogVisiblePassword.value = true break case 'delete': - ElMessageBox.confirm('This action will permanently delete the chat. Continue?', 'Warning', { - confirmButtonText: 'OK', - cancelButtonText: 'Cancel', - type: 'warning', + ElMessageBox.confirm(t('common.sales_in_2024', { msg: chat.brief }), { + confirmButtonType: 'danger', + tip: t('common.proceed_with_caution'), + confirmButtonText: t('dashboard.delete'), + cancelButtonText: t('common.cancel'), + customClass: 'confirm-no_icon', + autofocus: false, }).then(() => { _loading.value = true chatApi .deleteChat(chat.id) - .then((res) => { + .then(() => { ElMessage({ type: 'success', - message: res, + message: t('dashboard.delete_success'), }) emits('chatDeleted', chat.id) })