Toggle navigation
Toggle navigation
This project
Loading...
Sign in
卢阳
/
front_backend_zImage
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
ly0303521
2026-01-12 13:56:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
77cb422782c830719f652c77c2b7a090a5b8c7d6
77cb4227
1 parent
ad800c18
修改设置,点击"下载"按钮直接下载
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
z-image-generator/components/DetailModal.tsx
z-image-generator/components/ImageCard.tsx
z-image-generator/components/DetailModal.tsx
View file @
77cb422
...
...
@@ -122,9 +122,7 @@ const DetailModal: React.FC<DetailModalProps> = ({ image, onClose, onEdit, onGen
)}
<a
href={image.url}
target="_blank"
rel="noopener noreferrer"
href={`${image.url}?download=true`}
download={`z-${isVideo ? 'video' : 'image'}-${image.id}.${isVideo ? 'mp4' : 'png'}`}
className="flex items-center justify-center w-full py-3 bg-black dark:bg-white text-white dark:text-black rounded-xl font-medium hover:opacity-90 transition-opacity gap-2"
>
...
...
z-image-generator/components/ImageCard.tsx
View file @
77cb422
...
...
@@ -86,7 +86,9 @@ const ImageCard: React.FC<ImageCardProps> = ({ image, onClick, onLike, currentUs
onClick={(e) => {
e.stopPropagation();
const link = document.createElement('a');
link.href = image.url;
// Append ?download=true to force server to send attachment header
link.href = `${image.url}?download=true`;
// Filename is optional here as server header takes precedence, but good for fallback
link.download = `z-${isVideo ? 'video' : 'image'}-${image.id}.${isVideo ? 'mp4' : 'png'}`;
document.body.appendChild(link);
link.click();
...
...
Please
register
or
login
to post a comment