fix lot of thing
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user