仓库releases文件下载链接构建

This commit is contained in:
xxq250 2024-04-16 09:46:58 +08:00
parent 6feb3369c2
commit d84ebe0f42
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ class VersionReleasesController < ApplicationController
def download
tip_exception(404, '您访问的页面不存在或已被删除') if params["tag_name"].blank? || params["filename"].blank?
version = @repository.version_releases.find_by(tag_name: params["tag_name"])
attachment = @version.attachments.find_by(filename: params["filename"])
attachment = version.attachments.find_by(filename: params["filename"])
tip_exception(404, '您访问的页面不存在或已被删除') if attachment.blank?
redirect_to "/api/attachments/#{attachment.uuid}"
end