Merge branch 'standalone_develop' of https://gitlink.org.cn/Trustie/forgeplus into pm_project_develop

This commit is contained in:
2023-11-16 13:55:14 +08:00
3 changed files with 9 additions and 3 deletions

View File

@@ -39,7 +39,8 @@ class AttachmentsController < ApplicationController
filepath, ref = url.split("/")[-1].split("?")
url.gsub!(url.split("/")[-1], '')
Rails.logger.info("url===#{url}")
request_url = [domain, api_url, URI.encode(url), CGI.escape(filepath), "?ref=#{CGI.escape(ref.split('ref=')[1])}&access_token=#{User.where(admin: true).take&.gitea_token}"].join
Rails.logger.info(filepath)
request_url = [domain, api_url, URI.encode(url), URI.escape(filepath), "?ref=#{URI.escape(ref.split('ref=')[1])}&access_token=#{User.where(admin: true).take&.gitea_token}"].join
Rails.logger.info("request_url===#{request_url}")
response = Faraday.get(request_url)
filename = filepath