From 9e91427de093ab0dcce67347d56319c8d2c52e94 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 15 Nov 2023 08:43:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fixed=20=E5=AE=B9=E9=94=99=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/project_rank/_detail.json.jbuilder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/project_rank/_detail.json.jbuilder b/app/views/project_rank/_detail.json.jbuilder index d5b4b016b..c083033e1 100644 --- a/app/views/project_rank/_detail.json.jbuilder +++ b/app/views/project_rank/_detail.json.jbuilder @@ -3,8 +3,8 @@ owner_common = $redis_cache.hgetall("v2-owner-common:#{project_common["owner_id" json.id item[0] json.score item[1] json.name project_common["name"] -if project_common['identifier'].include?("/") - json.identifier project_common["identifier"].split('/')[1] +if project_common['identifier'].to_s.include?("/") + json.identifier project_common["identifier"].to_s.split('/')[1] json.owner do json.id nil json.type 'User' From 27bfeb5fc862de48da7716f05cf6490e2b71cdaa Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 15 Nov 2023 08:52:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fixed=20=E8=AF=84=E8=AE=BA=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E5=A2=9E=E5=8A=A0parent=5Fid=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E6=80=A7=E8=83=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20231115126452_add_journal_parent_id_index.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20231115126452_add_journal_parent_id_index.rb diff --git a/db/migrate/20231115126452_add_journal_parent_id_index.rb b/db/migrate/20231115126452_add_journal_parent_id_index.rb new file mode 100644 index 000000000..2ebca483a --- /dev/null +++ b/db/migrate/20231115126452_add_journal_parent_id_index.rb @@ -0,0 +1,5 @@ +class AddJournalParentIdIndex < ActiveRecord::Migration[5.2] + def change + add_index :journals, :parent_id + end +end From 9e4e30a495e5d895cf8b35d524c469e12c349251 Mon Sep 17 00:00:00 2001 From: yystopf Date: Thu, 16 Nov 2023 13:50:49 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=94=B9=EF=BC=9Aurl=E8=BD=AC?= =?UTF-8?q?=E4=B9=89=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 2bbccb495..e5362710c 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -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