增加红山开源项目同步,无效token log

This commit is contained in:
xxq250 2026-05-27 17:35:34 +08:00
parent 552b3c2f39
commit f502aa081e
1 changed files with 5 additions and 1 deletions

View File

@ -33,7 +33,11 @@ class Api::V1::Projects::BranchesController < Api::V1::BaseController
# request["Authorization"] = "Bearer #{params[:token]}"
response = https.request(request)
res = JSON.parse(response.body)
tip_exception "无效token" if res[0].blank? && res['status'].to_i == 401
if res[0].blank? && res['status'].to_i == 401
render :json => { "message": "无效token" }
return
end
render :json => response.read_body
end