修复:owners放在后面以防覆盖

This commit is contained in:
yystopf 2026-07-16 16:58:03 +08:00
parent 7b8107b95e
commit 20cb2c8eb8
1 changed files with 5 additions and 1 deletions

View File

@ -146,6 +146,7 @@ Rails.application.routes.draw do
post '/blockchain/issue/get_token_num', to: 'users#blockchain_get_issue_token_num'
get '/projects/blockchain/get_unclosed_issue_list', to: 'users#blockchain_get_unclosed_issue_list'
# resources :owners 路由必须放在 /:owner/:repo 通配符路由之前,以避免被误匹配
resources :owners, only: [:index, :show]
scope module: :organizations do
@ -531,7 +532,10 @@ Rails.application.routes.draw do
end
# Project Area START
scope "/:owner/:repo",constraints: { repo: /[^\/]+/ } do
scope "/:owner/:repo", constraints: lambda { |req|
# 避免匹配 'api/owners' 这样的路径
req.path !~ %r{^/api/owners}
}, repo: /[^\/]+/ do
scope do
get(
'/activity',