From f502aa081e457fa12e879cbd39c90c34dc6023db Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 27 May 2026 17:35:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BA=A2=E5=B1=B1=E5=BC=80?= =?UTF-8?q?=E6=BA=90=E9=A1=B9=E7=9B=AE=E5=90=8C=E6=AD=A5,=E6=97=A0?= =?UTF-8?q?=E6=95=88token=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/projects/branches_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/projects/branches_controller.rb b/app/controllers/api/v1/projects/branches_controller.rb index 568e206c6..ac2f6a485 100644 --- a/app/controllers/api/v1/projects/branches_controller.rb +++ b/app/controllers/api/v1/projects/branches_controller.rb @@ -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