feat(remote): 文件传输改用Electron IPC通道
- 主进程新增4个IPC handler处理远程文件操作 - 前端通过IPC调用而非浏览器fetch访问远程API - Remote服务新增3003端口专门处理文件传输 - 上传使用文件路径方案,下载使用保存对话框方案
This commit is contained in:
20
src/types/electron.d.ts
vendored
20
src/types/electron.d.ts
vendored
@@ -16,6 +16,26 @@ export interface ElectronAPI {
|
||||
onRemoteClipboardAutoSync: (callback: (text: string) => void) => () => void
|
||||
clipboardReadText: () => Promise<{ success: boolean; text?: string; error?: string }>
|
||||
clipboardWriteText: (text: string) => Promise<{ success: boolean; error?: string }>
|
||||
remoteFetchDrives: (serverHost: string, port: number, password?: string) => Promise<{
|
||||
success: boolean
|
||||
data?: Array<{ name: string; path: string; type: 'file' | 'dir'; size: number; modified: string }>
|
||||
error?: string
|
||||
}>
|
||||
remoteFetchFiles: (serverHost: string, port: number, filePath: string, password?: string) => Promise<{
|
||||
success: boolean
|
||||
data?: Array<{ name: string; path: string; type: 'file' | 'dir'; size: number; modified?: string }>
|
||||
error?: string
|
||||
}>
|
||||
remoteUploadFile: (serverHost: string, port: number, filePath: string, remotePath: string, password?: string) => Promise<{
|
||||
success: boolean
|
||||
error?: string
|
||||
}>
|
||||
remoteDownloadFile: (serverHost: string, port: number, fileName: string, remotePath: string, password?: string) => Promise<{
|
||||
success: boolean
|
||||
filePath?: string
|
||||
error?: string
|
||||
canceled?: boolean
|
||||
}>
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
||||
Reference in New Issue
Block a user