forked from Trustie/forgeplus
增加红山开源项目同步,无效token log
This commit is contained in:
parent
552b3c2f39
commit
f502aa081e
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue