Browse Source

fixed 文件无权限提示修改

pull/343/head
xxq250 2 years ago
parent
commit
743c63a796
3 changed files with 5 additions and 5 deletions
  1. +2
    -2
      app/interactors/gitea/delete_file_interactor.rb
  2. +2
    -2
      app/interactors/gitea/update_file_interactor.rb
  3. +1
    -1
      app/services/gitea/repository/entries/create_service.rb

+ 2
- 2
app/interactors/gitea/delete_file_interactor.rb View File

@@ -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



+ 2
- 2
app/interactors/gitea/update_file_interactor.rb View File

@@ -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



+ 1
- 1
app/services/gitea/repository/entries/create_service.rb View File

@@ -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?('*'))


Loading…
Cancel
Save