From e93a40f1a2ef177660fdb9584b13dcf014a54b6a Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 14 May 2024 20:26:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BC=82=E5=9C=B0=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E8=87=AA=E5=8A=A8=E9=AA=8C=E8=AF=81=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=B8=A4=E6=AC=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/web/helpers/user_must_auth.go | 8 +++++--- web/views/@default/login/validate.js | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/web/helpers/user_must_auth.go b/internal/web/helpers/user_must_auth.go index 529d6ed0..a9886466 100644 --- a/internal/web/helpers/user_must_auth.go +++ b/internal/web/helpers/user_must_auth.go @@ -216,9 +216,11 @@ func (this *userMustAuth) BeforeAction(actionPtr actions.ActionWrapper, paramNam this.login(action) return false } else { - // TODO 考虑IP变化时也需要验证,主要是考虑被反向代理的情形 - action.RedirectURL("/login/validate?from=" + url.QueryEscape(action.Request.URL.String())) - return false + if !lists.ContainsString([]string{"/messages/badge", "/dns/tasks/check", "/clusters/tasks/check"}, action.Request.URL.Path) { + // TODO 考虑IP变化时也需要验证,主要是考虑被反向代理的情形 + action.RedirectURL("/login/validate?from=" + url.QueryEscape(action.Request.URL.String())) + return false + } } } } diff --git a/web/views/@default/login/validate.js b/web/views/@default/login/validate.js index ebd9b58b..4d7b7f4d 100644 --- a/web/views/@default/login/validate.js +++ b/web/views/@default/login/validate.js @@ -10,7 +10,6 @@ Tea.context(function () { this.$post("$") .params({localSid: sid, "ip": ip}) - .post() .success(function (resp) { if (!resp.data.isOk) { window.location = "/logout" @@ -28,7 +27,7 @@ Tea.context(function () { } else { window.location = "/dashboard" } - }) + }, 100) }) }) }) \ No newline at end of file