From f99fc7bb0390519bb2cc36a5b92dd407d1c15939 Mon Sep 17 00:00:00 2001 From: zhaojisen <1301338853@qq.com> Date: Tue, 31 Dec 2024 16:07:39 +0800 Subject: [PATCH] Perf: Change SFTP Connect Token --- ui/src/components/pamFileList/index.vue | 3 +-- ui/src/hooks/useFileManage.ts | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/src/components/pamFileList/index.vue b/ui/src/components/pamFileList/index.vue index 239066e2..57375f92 100644 --- a/ui/src/components/pamFileList/index.vue +++ b/ui/src/components/pamFileList/index.vue @@ -203,8 +203,7 @@ const { t } = useI18n(); const fileManageStore = useFileManageStore(); const isLoaded = ref(false); -// todo)) 还原为 false -const isShowList = ref(true); +const isShowList = ref(false); const settingDrawer = ref(false); const tabDefaultValue = ref('fileManage'); const tableData = ref([]); diff --git a/ui/src/hooks/useFileManage.ts b/ui/src/hooks/useFileManage.ts index 28ad0b71..cbd4e8f6 100644 --- a/ui/src/hooks/useFileManage.ts +++ b/ui/src/hooks/useFileManage.ts @@ -3,15 +3,15 @@ import { type UploadFileInfo, useMessage } from 'naive-ui'; import { useWebSocket } from '@vueuse/core'; import { useFileManageStore } from '@/store/modules/fileManage.ts'; +import { v4 as uuid } from 'uuid'; import { BASE_WS_URL } from '@/config'; import mittBus from '@/utils/mittBus.ts'; -import { v4 as uuid } from 'uuid'; +import type { Ref } from 'vue'; import type { RouteRecordNameGeneric } from 'vue-router'; import type { MessageApiInjection } from 'naive-ui/es/message/src/MessageProvider'; import type { IFileManage, IFileManageConnectData, IFileManageSftpFileItem } from '@/hooks/interface'; -import { Ref } from 'vue'; export enum MessageType { CONNECT = 'CONNECT', @@ -42,7 +42,7 @@ const getFileManageUrl = () => { let fileConnectionUrl: string = ''; if (routeName === 'Terminal') { - fileConnectionUrl = urlParams ? `${BASE_WS_URL}/koko/ws/sftp/?${urlParams.toString()}` : ''; + fileConnectionUrl = urlParams ? `${BASE_WS_URL}/koko/ws/sftp/?token=${urlParams.toString().split('&')[1].split('=')[1]}` : ''; return fileConnectionUrl; }