fix lot of thing

This commit is contained in:
2025-11-01 20:14:35 +08:00
parent 39dfb62cbf
commit f006729311
16 changed files with 23303 additions and 3996 deletions

View File

@@ -181,16 +181,15 @@ class MainWindow(CustomFluentWindow):
# 窗口大小改变时更新背景
def imagePreview(self, _id):
# 使用V4 API进行预览
url = f"/file/preview/{_id}"
self.previewBox = OptimizedPreviewBox(self, url)
# 直接传递文件ID给OptimizedPreviewBox让它内部使用getFileUrl获取临时URL
self.previewBox = OptimizedPreviewBox(self, fileId=_id)
if self.previewBox.exec():
pass
def txtPreview(self, _id):
# 使用V4 API获取内容
url = f"/file/content/{_id}"
self.previewBox = PreviewTextBox(self, url, _id)
# 直接使用fileUri不再构建URL
# _id 应该是 cloudreve:// 格式的URI
self.previewBox = PreviewTextBox(self, "", _id)
if self.previewBox.exec():
pass