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