feat(remote): 完善远程桌面认证机制

1. 修复 WebSocket 认证漏洞:WebSocket 连接现在需要认证(支持 URL 参数 password 或 Cookie token)

2. 支持 URL 参数自动登录:HTTP 请求带 ?password=xxx 参数时会自动验证并设置 cookie

3. 主程序添加密码配置:
   - RemoteDevice 类型添加 password 字段
   - ConfigDialog 添加密码输入框
   - 打开远程桌面时传递 password 参数

4. 修复 remote/public/js/app.js:
   - 从 URL 参数获取 password 并传递给 WebSocket 连接
   - 移除错误的 token 当作 password 的代码

5. 添加密码变化检测:修改密码后自动刷新页面重新认证,无需重启 remote 服务

6. 文件传输 API 支持 password 参数
This commit is contained in:
2026-03-09 00:54:48 +08:00
parent 8531d916a3
commit 50cfc8835f
10 changed files with 187 additions and 32 deletions

View File

@@ -4,6 +4,7 @@ export interface RemoteDevice {
serverHost: string
desktopPort: number
gitPort: number
password?: string
}
export interface RemoteConfig {