更改:tree返回结构体适配以及生成token需新增scopes参数

This commit is contained in:
yystopf 2023-11-30 10:36:55 +08:00
parent df0ef313f6
commit a0265d4808
2 changed files with 4 additions and 4 deletions

View File

@ -29,7 +29,7 @@ class Gitea::User::GenerateTokenService < Gitea::ClientService
end
def request_params
{ name: "#{@username}-#{token_name}" }
{ name: "#{@username}-#{token_name}", scopes: ["all"] }
end
def token_name

View File

@ -1,6 +1,6 @@
json.total_count @result_object['total_count']
json.sha @result_object['sha']
json.entries @result_object['tree'].each do |entry|
json.total_count @result_object[:data]['total_count'].to_i
json.sha @result_object[:data]['sha']
json.entries @result_object[:data]['tree'].each do |entry|
json.name entry['path']
json.mode entry['mode']
json.type entry['type'] === 'blob' ? 'file' : 'dir'