From 743c63a7966a82b99d6ff1bc72fc6aa39fa1ef4e Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 30 Aug 2023 16:09:28 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E6=96=87=E4=BB=B6=E6=97=A0=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8F=90=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/interactors/gitea/delete_file_interactor.rb | 4 ++-- app/interactors/gitea/update_file_interactor.rb | 4 ++-- app/services/gitea/repository/entries/create_service.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/interactors/gitea/delete_file_interactor.rb b/app/interactors/gitea/delete_file_interactor.rb index 68c22f555..03ddf4230 100644 --- a/app/interactors/gitea/delete_file_interactor.rb +++ b/app/interactors/gitea/delete_file_interactor.rb @@ -43,8 +43,8 @@ module Gitea if response.status == 200 @result = JSON.parse(response.body) else - Rails.logger.error("Gitea::Repository::Entries::DeleteService error======#{response.body}") - @error = "册除失败" + Rails.logger.error("Gitea::Repository::Entries::DeleteService error[#{response.status}]======#{response.body}") + @error = "删除失败,请确认该分支是否是保护分支。" end end diff --git a/app/interactors/gitea/update_file_interactor.rb b/app/interactors/gitea/update_file_interactor.rb index 0487a1ea0..1b729e2c8 100644 --- a/app/interactors/gitea/update_file_interactor.rb +++ b/app/interactors/gitea/update_file_interactor.rb @@ -43,8 +43,8 @@ module Gitea if response.status == 200 @result = JSON.parse(response.body) else - Rails.logger.info("Gitea::Repository::Entries::UpdateService error======#{response.body}") - @error = "更新失败" + Rails.logger.error("Gitea::Repository::Entries::UpdateService error[#{response.status}]======#{response.body}") + @error = "更新失败,请确认该分支是否是保护分支。" end end diff --git a/app/services/gitea/repository/entries/create_service.rb b/app/services/gitea/repository/entries/create_service.rb index e10dcadc6..ac27b3afb 100644 --- a/app/services/gitea/repository/entries/create_service.rb +++ b/app/services/gitea/repository/entries/create_service.rb @@ -53,7 +53,7 @@ class Gitea::Repository::Entries::CreateService < Gitea::ClientService def status_payload(status, body) case status when 201 then success(json_parse!(body)) - when 403 then error("你没有权限操作!") + when 403 then error("你没有权限操作,请确认该分支是否是保护分支。") when 404 then error("你操作的链接不存在!") when 422 if @body[:new_branch].present? && (@body[:new_branch].include?('/') || @body[:new_branch].include?('\'') || @body[:new_branch].include?('^') || @body[:new_branch].include?('*'))