From 2ee0838d8a761c18e315f2997b3de6a8e329d940 Mon Sep 17 00:00:00 2001 From: hoteas Date: Thu, 25 Aug 2022 13:06:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=91=E7=8A=B6=E7=BB=93=E6=9E=84=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/application.go b/application.go index c46e7ee..4148797 100644 --- a/application.go +++ b/application.go @@ -374,15 +374,17 @@ func (that *Application) handler(w http.ResponseWriter, req *http.Request) { }() //访问拦截true继续false暂停 - connectListenerLen := len(that.connectListener) - - for i := 0; i < connectListenerLen; i++ { - - if that.connectListener[i](&context) { + connectListenerLen := len(that.connectListener) - 1 + for true { + if connectListenerLen < 0 { + break + } + if that.connectListener[connectListenerLen](&context) { context.View() return } + connectListenerLen-- } //接口服务