Skip to content

Commit

Permalink
【BugFix】分享页面无法查看图片和视频
Browse files Browse the repository at this point in the history
1. 需要调用getDocFileLinkForPreview
2. imgList页面未传入shareId
3. downloadImg接口需要支持非登录状态下调用(图片不能实时预览)
  • Loading branch information
RainyGao-GitHub committed Mar 18, 2024
1 parent f7fd3e8 commit b73905b
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion WebRoot/web/imageViewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if(!fileLink || fileLink != null)
{
var docInfo = getDocInfoFromRequestParamStr();
getDocFileLink(docInfo, showImage, showErrorMessage);
getDocFileLinkForPreview(docInfo, showImage, showErrorMessage);
}
else
{
Expand Down
7 changes: 4 additions & 3 deletions WebRoot/web/imgListViewerForArt.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
//console.log("getImgList doc:", doc);
if(isPictureFile(doc.name) == true)
{
doc.shareId = docInfo.shareId;
imgList.push(doc);
if(doc.docId == docInfo.docId)
{
Expand All @@ -99,15 +100,15 @@
console.log("getImgList imgList:", imgList);
console.log("getImgList index:", index);

getDocFileLink(imgList[index], showImage, showErrorMessage);
getDocFileLinkForPreview(imgList[index], showImage, showErrorMessage);
}

function gotoPreviousDoc()
{
if(index > 0)
{
index--;
getDocFileLink(imgList[index], showImage, showErrorMessage);
getDocFileLinkForPreview(imgList[index], showImage, showErrorMessage);
}
}

Expand All @@ -116,7 +117,7 @@
if(index < imgList.length -1)
{
index++;
getDocFileLink(imgList[index], showImage, showErrorMessage);
getDocFileLinkForPreview(imgList[index], showImage, showErrorMessage);
}
}

Expand Down
7 changes: 4 additions & 3 deletions WebRoot/web/imgListViewerForBootstrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
//console.log("getImgList doc:", doc);
if(isPictureFile(doc.name) == true)
{
doc.shareId = docInfo.shareId;
imgList.push(doc);
if(doc.docId == docInfo.docId)
{
Expand All @@ -80,15 +81,15 @@
console.log("getImgList imgList:", imgList);
console.log("getImgList index:", index);

getDocFileLink(imgList[index], showImage, showErrorMessage);
getDocFileLinkForPreview(imgList[index], showImage, showErrorMessage);
}

function gotoPreviousDoc()
{
if(index > 0)
{
index--;
getDocFileLink(imgList[index], showImage, showErrorMessage);
getDocFileLinkForPreview(imgList[index], showImage, showErrorMessage);
}
}

Expand All @@ -97,7 +98,7 @@
if(index < imgList.length -1)
{
index++;
getDocFileLink(imgList[index], showImage, showErrorMessage);
getDocFileLinkForPreview(imgList[index], showImage, showErrorMessage);
}
}

Expand Down
2 changes: 1 addition & 1 deletion WebRoot/web/imgViewerForArt.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
$("#img-div").css("margin-top","0");
console.log("imgViewerForArt.html => docInfo:",docInfo);

getDocFileLink(docInfo, showImage, showErrorMessage);
getDocFileLinkForPreview(docInfo, showImage, showErrorMessage);

function showImage(fileLink)
{
Expand Down
2 changes: 1 addition & 1 deletion WebRoot/web/imgViewerForBootstrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
var fileLink = docInfo.fileLink;
if(!fileLink || fileLink != null)
{
getDocFileLink(docInfo, showImage, showErrorMessage);
getDocFileLinkForPreview(docInfo, showImage, showErrorMessage);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion WebRoot/web/videoViewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
document.title = docInfo.name;

docInfo.fileSuffix = getFileSuffix(docInfo.name);
getDocFileLink(docInfo, showVideo, showErrorMessage);
getDocFileLinkForPreview(docInfo, showVideo, showErrorMessage);

function showVideo(fileLink)
{
Expand Down
2 changes: 1 addition & 1 deletion WebRoot/web/videoViewerForArt.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
console.log("videoViewerForArt.html => docInfo:",docInfo);

docInfo.fileSuffix = getFileSuffix(docInfo.name);
getDocFileLink(docInfo, showVideo, showErrorMessage);
getDocFileLinkForPreview(docInfo, showVideo, showErrorMessage);

function showVideo(fileLink)
{
Expand Down
2 changes: 1 addition & 1 deletion WebRoot/web/videoViewerForBootstrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
var fileLink = docInfo.fileLink;
if(!fileLink || fileLink != null)
{
getDocFileLink(docInfo, showVideo, showErrorMessage);
getDocFileLinkForPreview(docInfo, showVideo, showErrorMessage);
}
else
{
Expand Down
1 change: 1 addition & 0 deletions src/com/DocSystem/controller/MyInterceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class MyInterceptor extends HandlerInterceptorAdapter{
"Doc/downloadDocPrepare",
"Doc/downloadHistoryDocPrepare",
"Doc/downloadDoc",
"Doc/downloadImg",
"Doc/doGetTmpFile",
"Doc/DocToPDF",
"Doc/lockDoc",
Expand Down

0 comments on commit b73905b

Please sign in to comment.