fixed 复杂文件名称处理
This commit is contained in:
parent
da299195a0
commit
a2ebf3dbd6
|
@ -74,7 +74,7 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def sub_entries
|
def sub_entries
|
||||||
file_path_uri = URI.escape(URI.encode(params[:filepath].to_s.strip))
|
file_path_uri = URI.parse(URI.encode(params[:filepath].to_s.strip))
|
||||||
|
|
||||||
if @project.educoder?
|
if @project.educoder?
|
||||||
if params[:type] === 'file'
|
if params[:type] === 'file'
|
||||||
|
@ -127,7 +127,7 @@ class RepositoriesController < ApplicationController
|
||||||
@commits = Educoder::Repository::Commits::ListService.call(@project&.project_educoder&.repo_name)
|
@commits = Educoder::Repository::Commits::ListService.call(@project&.project_educoder&.repo_name)
|
||||||
else
|
else
|
||||||
if params[:filepath].present?
|
if params[:filepath].present?
|
||||||
file_path_uri = URI.escape(URI.encode(params[:filepath].to_s.strip))
|
file_path_uri = URI.parse(URI.encode(params[:filepath].to_s.strip))
|
||||||
@hash_commit = Gitea::Repository::Commits::FileListService.new(@owner.login, @project.identifier, file_path_uri,
|
@hash_commit = Gitea::Repository::Commits::FileListService.new(@owner.login, @project.identifier, file_path_uri,
|
||||||
sha: params[:sha], page: params[:page], limit: params[:limit], token: @owner&.gitea_token).call
|
sha: params[:sha], page: params[:page], limit: params[:limit], token: @owner&.gitea_token).call
|
||||||
else
|
else
|
||||||
|
@ -323,7 +323,7 @@ class RepositoriesController < ApplicationController
|
||||||
# TODO 获取最新commit信息
|
# TODO 获取最新commit信息
|
||||||
def project_commits
|
def project_commits
|
||||||
if params[:filepath].present?
|
if params[:filepath].present?
|
||||||
file_path_uri = URI.escape(URI.encode(params[:filepath].to_s.strip))
|
file_path_uri = URI.parse(URI.encode(params[:filepath].to_s.strip))
|
||||||
Gitea::Repository::Commits::FileListService.new(@project.owner.login, @project.identifier, file_path_uri,
|
Gitea::Repository::Commits::FileListService.new(@project.owner.login, @project.identifier, file_path_uri,
|
||||||
sha: get_ref, page: 1, limit: 1, token: @project&.owner&.gitea_token).call
|
sha: get_ref, page: 1, limit: 1, token: @project&.owner&.gitea_token).call
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue