fixed 文件增加编辑删除操作无权限提示修改
This commit is contained in:
parent
09e674f0c1
commit
53b66f6145
|
@ -42,6 +42,9 @@ module Gitea
|
||||||
def render_result(response)
|
def render_result(response)
|
||||||
if response.status == 200
|
if response.status == 200
|
||||||
@result = JSON.parse(response.body)
|
@result = JSON.parse(response.body)
|
||||||
|
else
|
||||||
|
Rails.logger.error("Gitea::Repository::Entries::DeleteService error[#{response.status}]======#{response.body}")
|
||||||
|
@error = "删除失败,请确认该分支是否是保护分支。"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,9 @@ module Gitea
|
||||||
def render_result(response)
|
def render_result(response)
|
||||||
if response.status == 200
|
if response.status == 200
|
||||||
@result = JSON.parse(response.body)
|
@result = JSON.parse(response.body)
|
||||||
|
else
|
||||||
|
Rails.logger.error("Gitea::Repository::Entries::UpdateService error[#{response.status}]======#{response.body}")
|
||||||
|
@error = "更新失败,请确认该分支是否是保护分支。"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ class Gitea::Repository::Entries::CreateService < Gitea::ClientService
|
||||||
def status_payload(status, body)
|
def status_payload(status, body)
|
||||||
case status
|
case status
|
||||||
when 201 then success(json_parse!(body))
|
when 201 then success(json_parse!(body))
|
||||||
when 403 then error("你没有权限操作!")
|
when 403 then error("你没有权限操作,请确认该分支是否是保护分支。")
|
||||||
when 404 then error("你操作的链接不存在!")
|
when 404 then error("你操作的链接不存在!")
|
||||||
when 422
|
when 422
|
||||||
if @body[:new_branch].present? && (@body[:new_branch].include?('/') || @body[:new_branch].include?('\'') || @body[:new_branch].include?('^') || @body[:new_branch].include?('*'))
|
if @body[:new_branch].present? && (@body[:new_branch].include?('/') || @body[:new_branch].include?('\'') || @body[:new_branch].include?('^') || @body[:new_branch].include?('*'))
|
||||||
|
@ -61,7 +61,9 @@ class Gitea::Repository::Entries::CreateService < Gitea::ClientService
|
||||||
else
|
else
|
||||||
error("#{filepath}文件已存在,不能重复创建!")
|
error("#{filepath}文件已存在,不能重复创建!")
|
||||||
end
|
end
|
||||||
else error("系统错误!")
|
else
|
||||||
|
Rails.logger.error("Gitea api url==#{url},status:#{status},body=#{body}")
|
||||||
|
error("系统错误!")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue