From 8bfa73a67a2292da32cecbe581d84caf4313624b Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 11 Feb 2025 18:33:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=BC=E5=87=BA=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/logManage/exportFile.ts | 4 + src/views/logManage/exportFile/index.vue | 182 +++++++++++------------ 2 files changed, 92 insertions(+), 94 deletions(-) diff --git a/src/api/logManage/exportFile.ts b/src/api/logManage/exportFile.ts index 85c29ccf..1136b642 100644 --- a/src/api/logManage/exportFile.ts +++ b/src/api/logManage/exportFile.ts @@ -1,3 +1,5 @@ +import { CACHE_SESSION_CRYPTO_API } from '@/constants/cache-keys-constants'; +import { sessionGet } from '@/utils/cache-session-utils'; import { request } from '@/plugins/http-fetch'; /** @@ -62,6 +64,7 @@ export function updateFTPInfo(data: Record) { url: `/lm/table/ftp`, method: 'post', data: data, + crypto: sessionGet(CACHE_SESSION_CRYPTO_API) !== 'false', }); } @@ -74,6 +77,7 @@ export function getFTPInfo() { return request({ url: `/lm/table/ftp`, method: 'get', + crypto: sessionGet(CACHE_SESSION_CRYPTO_API) !== 'false', }); } diff --git a/src/views/logManage/exportFile/index.vue b/src/views/logManage/exportFile/index.vue index 60d35470..b43cafee 100644 --- a/src/views/logManage/exportFile/index.vue +++ b/src/views/logManage/exportFile/index.vue @@ -290,13 +290,13 @@ type ModalStateType = { /**FTP日志对象信息状态 */ let modalState: ModalStateType = reactive({ openByEdit: false, - title: 'FTP上报服务设置', + title: '设置远程备份配置', from: { - useranme: '', + username: '', password: '', toIp: '', toPort: 22, - protocol: 'ftp', + enable: false, dir: '', }, confirmLoading: false, @@ -343,12 +343,12 @@ function fnModalVisibleByEdit() { hide(); if (res.code === RESULT_CODE_SUCCESS && res.data) { modalState.from = Object.assign(modalState.from, res.data); - modalState.title = 'FTP Info'; + modalState.title = 'Setting Remote Backup'; modalState.openByEdit = true; } else { message.error(res.msg, 3); - modalState.title = 'FTP Info'; - modalState.openByEdit = true; + modalState.title = 'Setting Remote Backup'; + modalState.openByEdit = false; } }); } @@ -361,9 +361,10 @@ function fnModalOk() { updateFTPInfo(from) .then(res => { if (res.code === RESULT_CODE_SUCCESS) { - message.success(`FTP configuration saved successfully`, 3); + message.success(`Configuration saved successfully`, 3); + fnModalCancel(); } else { - message.warning(`FTP configuration save exception`, 3); + message.warning(`Configuration save exception`, 3); } }) .finally(() => { @@ -389,7 +390,7 @@ function fnSyncFileToFTP(row: Record) { putFTPInfo(row.filePath, row.fileName) .then(res => { if (res.code === RESULT_CODE_SUCCESS) { - message.success(`OK`, 3); + message.success(t('common.operateOk'), 3); } else { message.warning(res.msg, 3); } @@ -435,7 +436,7 @@ function fnSyncFileToFTP(row: Record) {