Browse Source

仓库releases文件下载链接构建

pull/347/head
xxq250 2 years ago
parent
commit
6feb3369c2
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/controllers/version_releases_controller.rb

+ 2
- 2
app/controllers/version_releases_controller.rb View File

@@ -127,9 +127,9 @@ class VersionReleasesController < ApplicationController
end

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


Loading…
Cancel
Save