Browse Source

FIX 临时处理获取readme文件问题

tags/v3.0.4(standalone)
jasder 5 years ago
parent
commit
ffa74e92a3
2 changed files with 6 additions and 0 deletions
  1. +5
    -0
      app/controllers/repositories_controller.rb
  2. +1
    -0
      app/views/repositories/entries.json.jbuilder

+ 5
- 0
app/controllers/repositories_controller.rb View File

@@ -53,6 +53,11 @@ class RepositoriesController < ApplicationController
@entries = Gitea::Repository::Entries::ListService.new(@owner, @project.identifier, ref: @ref).call
@entries = @entries.present? ? @entries.sort_by{ |hash| hash['type'] } : []
@path = Gitea.gitea_config[:domain]+"/#{@project.owner.login}/#{@project.identifier}/raw/branch/#{@ref}/"
# TODO
# 临时处理readme文件问题
admin = User.where(admin: true).last
@readme = Gitea::Repository::Readme::GetService.call(@owner.login, @project.identifier, @ref, admin&.gitea_token)
end
end


+ 1
- 0
app/views/repositories/entries.json.jbuilder View File

@@ -59,4 +59,5 @@ if @project.forge?
end
end
end
json.readme @readme
end

Loading…
Cancel
Save